Browse Source

proresdec: Check yuv slice data sizes.

Fixes overread
Fixes Ticket812
Bug found by: Oana Stratulat

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.10
Michael Niedermayer 14 years ago
parent
commit
2b73cddd40
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/proresdec2.c

+ 2
- 1
libavcodec/proresdec2.c View File

@@ -443,7 +443,8 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int
v_data_size = slice->data_size - y_data_size - u_data_size - hdr_size;
if (hdr_size > 7) v_data_size = AV_RB16(buf + 6);

if (y_data_size < 0 || u_data_size < 0 || v_data_size < 0) {
if (y_data_size < 0 || u_data_size < 0 || v_data_size < 0
|| hdr_size+y_data_size+u_data_size+v_data_size > slice->data_size){
av_log(avctx, AV_LOG_ERROR, "invalid plane data size\n");
return -1;
}


Loading…
Cancel
Save