[FFmpeg-devel] flashsv error due to negative linesize value - not an intentional cross post!

Jason Askew jason.askew
Wed May 9 21:45:22 CEST 2007

To get even more specific, it is this line:

             dptr[j] = nsptr[j];

in copy_region_enc that is failing, and it is happening at the ends of
the row / column runs.

In short, I really need more info on the meaning of linesize being
negative.  I've dug through the past mail archive and found:

> It's up to your program to pack it in an acceptable fashion. linesize
> can be absolutely anything; it has nothing to do with the width of the
> picture. In fact it can be negative if the decoder stores the picture
> upside-down, iirc.


> its not meaningless, the image can be flipped and data[0] can point to
> the last line

Ahh, this may be the key.

So, if linesize is negative, then data[0] will point to the end of the
buffer for plane [0]?  or will it point to the beginning of the first
line of the last row?

Here's another way to put it:  is

data[0][linesize[0] * row + column]

always valid even with a negative linesize, assuming a positive row
and column value?

Just trying to get the fine details down here so I can get this fixed.
 I'm getting close.


More information about the ffmpeg-devel mailing list