[Xvid-devel] Bug in xvid_encraw (version 1.3.2)

Jim Bennett drj1270 at yahoo.com
Tue Jun 19 20:40:04 CEST 2012


Let me know if I should report this bug elsewhere.

I would attach diffs, but I don't have a way of testing the change.

In the routine read_pgmdata, at line 1983, there is currently:

        /*  I don't know why, but this seems needed */
        fread(&dummy, 1, 1, handle);


This read of a byte is indeed necessary, but it is in the wrong
location.  It should be placed in read_pgmheader, following
the fscanf (at line 1944).

What's going on is that the fscanf reads the three integer fields
and the terminating new line, but then it backs up one character,
in case the terminating character needs to be processed.  So the
fread of one byte is needed to gobble up that terminating
character.

With the current placement of the fread, the first frame of the
video is actually read in incorrectly.  Somewhat surprisingly,
the only visual artifact I noticed was that the left edge of the
initial frame appeared to have some garbage pixels in it.


- Jim Bennett


More information about the Xvid-devel mailing list