Summary: | avidemux cannot load project on AMD64 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Martin Väth <martin> |
Component: | Current packages | Assignee: | Marc Hildebrand (RETIRED) <zypher> |
Status: | RESOLVED NEEDINFO | ||
Severity: | minor | CC: | media-video |
Priority: | High | Keywords: | PMASKED |
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Patch to fix the scanf/fscanf calls
scanf-fixes (for e.g. 64bit) for avidemux-2.3_preview2 |
Description
Martin Väth
2005-09-03 16:15:16 UTC
Created attachment 97047 [details, diff]
Patch to fix the scanf/fscanf calls
Since there are no new avidemux versions in the portage tree for a long time now, I decided to repair the old "current" version:
<=avidemux-2.0.42 is not nearly 64-bit clean: It uses scanf/fscanf and printf/fprintf with "%ul" and passes only a (pointer to an) uint32 object
(similar things happen also for other arguments).
In the appended patch, I corrected the (about 20) scanf/fscanf calls, but without any automatism, I will not repair the several hundred printf/fprintf calls (does somebody know of a script which simply casts printf/fprintf arguments into the right form when the first argument is a constant string?). However, for amd64 the printf/fprintf calls seem to work anyway, probably due to the fact that function parameters are passsed in registers and not on the stack (which would allocate the wrong size), but this is just a guess and not really tested (for certain parameter combinations or too many parameters the printf calls might probably fail anyway).
Anyway, the attached patch of scanf/fscanf fixes at least the reported problem, so on 64-Bit machines, avidemux will certainly work better with this patch than without it, but I wouldn't rely too much an the full functionality on AMD64 (although I observed no further problems so far, but I am using only very few of the functionality of avidemux).
Could you test w/ the ebuild from Bug 150175? Doesn't make sense to hack outdated versions that are completely unsupported upstream IMHO. Created attachment 102303 [details, diff]
scanf-fixes (for e.g. 64bit) for avidemux-2.3_preview2
Yes, of course: This was only a temporary hack until the upstream version is in the gentoo tree. avidemux-2.3 uses a completely different mechanism to save projects (it uses spidermonkey), so it is not surprising that the described effect does not occur anymore.
However, when looking through the source code, I still found some suspicious scanf calls although upstreams seems to have fixed most of them. I attach some quick-and-dirty hacks which presumable fixes the one I found for avidemux-2.3_preview2.
Martin, whats the status with 2.3.0? It is the same as with avidemux-2.3_preview2: The above patch applies (with only one small offset difference) which means that the upstream code is not fixed yet. In fact, I had reported it upstream but had received no reply. (In reply to comment #5) > It is the same as with avidemux-2.3_preview2: The above patch applies (with > only one small offset difference) which means that the upstream code is not > fixed yet. In fact, I had reported it upstream but had received no reply. > yes, were not using previe2, were using 2.3.0 now. :) I don't understand why this is marked as "need info" now; I hope that I am not the reason. Maybe my previous posting was unclear: Concerning this bug there is no difference beetween 2.3_preview2 and 2.3.0. The same patch works (with only one offset difference). I do not know whether the patch for 2.3* is just of a cosmetical nature, or whether really something will go wrong without it (as was the case with 2.0.42), but I am rather sure that it cannot hurt and fixes *potential* bugs. |