Browse Source

Fix potential overreads in rv34 decoder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9a0a64cb26)
tags/n0.8.4
Laurent Aimar Michael Niedermayer 14 years ago
parent
commit
30d7dce94f
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      libavcodec/rv34.c

+ 3
- 2
libavcodec/rv34.c View File

@@ -1443,6 +1443,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
slice_count = (*buf++) + 1;
slices_hdr = buf + 4;
buf += 8 * slice_count;
buf_size -= 1 + 8 * slice_count;
}else
slice_count = avctx->slice_count;

@@ -1461,7 +1462,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
if( (avctx->skip_frame >= AVDISCARD_NONREF && si.type==AV_PICTURE_TYPE_B)
|| (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=AV_PICTURE_TYPE_I)
|| avctx->skip_frame >= AVDISCARD_ALL)
return buf_size;
return avpkt->size;

for(i=0; i<slice_count; i++){
int offset= get_slice_offset(avctx, slices_hdr, i);
@@ -1510,7 +1511,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
}
s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...)
}
return buf_size;
return avpkt->size;
}

av_cold int ff_rv34_decode_end(AVCodecContext *avctx)


Loading…
Cancel
Save