[Ffmpeg-cvslog] r8498 - trunk/libavcodec/lzw.c
Baptiste Coudurier
baptiste.coudurier
Sun Mar 25 13:09:51 CEST 2007
Michael Niedermayer wrote:
> Hi
>
> On Sun, Mar 25, 2007 at 12:23:05AM +0100, bcoudurier wrote:
>> Author: bcoudurier
>> Date: Sun Mar 25 00:23:05 2007
>> New Revision: 8498
>>
>> Modified:
>> trunk/libavcodec/lzw.c
>>
>> Log:
>> break if eob is reached to avoid reading one too much byte
>>
>> Modified: trunk/libavcodec/lzw.c
>> ==============================================================================
>> --- trunk/libavcodec/lzw.c (original)
>> +++ trunk/libavcodec/lzw.c Sun Mar 25 00:23:05 2007
>> @@ -77,6 +77,7 @@ static int lzw_get_code(struct LZWState
>> s->bs = sizbuf;
>> if(!sizbuf) {
>> s->eob_reached = 1;
>> + break;
>> }
>
> * this check does not prevent reading over the end
at least it stops reading before the end.
> * this check only catches one eob case in the GIF branch of the if()
> * you are not maintainer of LZW
nobody is, it works for me (tm), and Im maintainer of gif, that case if
specific to gif, so Its like I am maintainer of that part of lzw, which
was in gifdec.c before.
> * how do you know the code isnt intended to read a byte or 2 too much for
> simplicity and optimization reasons like almost all other code in lavc
> too?
Because buf_size is one less than what's actually read, and that's
problematic.
> considering these, please revert it
feel free to do IF you correct the code in a better way.
--
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A. http://www.smartjog.com
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
More information about the ffmpeg-cvslog
mailing list