[FFmpeg-devel] [PATCH] IFF: Add error checking to byterun1 decoder

Sebastian Vater cdgs.basty
Mon May 17 00:35:37 CEST 2010


Stefano Sabatini a ?crit :
> On date Monday 2010-05-17 00:08:55 +0200, Sebastian Vater encoded:
>   
>> @@ -306,7 +313,7 @@ static int decode_frame_byterun1(AVCodecContext *avctx,
>>      const uint8_t *buf = avpkt->data;
>>      int buf_size = avpkt->size;
>>      const uint8_t *buf_end = buf+buf_size;
>> -    int y, plane;
>> +    int y, plane, err;
>>  
>>      if (avctx->reget_buffer(avctx, &s->frame) < 0){
>>          av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
>> @@ -319,7 +326,11 @@ static int decode_frame_byterun1(AVCodecContext *avctx,
>>                  uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
>>                  memset(row, 0, avctx->width);
>>                  for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) {
>> -                    buf += decode_byterun(s->planebuf, s->planesize, buf, buf_end);
>> +                    if ((err = decode_byterun(s->planebuf, s->planesize, buf, buf_end)) < 0) {
>> +                        av_log(avctx, AV_LOG_ERROR, "IFF byterun1 stream truncated\n");
>> +                        return err;
>> +                    }
>> +                    buf += err;
>>     
>
> buf += err looks strange, buf += ret should look saner.
>   

Fixed by changing err(or) to res(ult).

-- 

Best regards,
                   :-) Basty/CDGS (-:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iff-byterun1-error.patch
Type: text/x-patch
Size: 4483 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100517/e4066e5f/attachment.bin>



More information about the ffmpeg-devel mailing list