Commit bdb8d996 authored by Benjamin Larsson's avatar Benjamin Larsson

Proper subpacket size check for cook multichannel files.

Originally committed as revision 18693 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent bb1135c8
...@@ -72,7 +72,7 @@ typedef struct { ...@@ -72,7 +72,7 @@ typedef struct {
typedef struct { typedef struct {
int ch_idx; int ch_idx;
unsigned int size; int size;
int num_channels; int num_channels;
int cookversion; int cookversion;
int samples_per_frame; int samples_per_frame;
...@@ -1011,6 +1011,10 @@ static int cook_decode_frame(AVCodecContext *avctx, ...@@ -1011,6 +1011,10 @@ static int cook_decode_frame(AVCodecContext *avctx,
for(i=1;i<q->num_subpackets;i++){ for(i=1;i<q->num_subpackets;i++){
q->subpacket[i].size = 2 * buf[avctx->block_align - q->num_subpackets + i]; q->subpacket[i].size = 2 * buf[avctx->block_align - q->num_subpackets + i];
q->subpacket[0].size -= q->subpacket[i].size + 1; q->subpacket[0].size -= q->subpacket[i].size + 1;
if (q->subpacket[0].size < 0) {
av_log(avctx,AV_LOG_DEBUG,"frame subpacket size total > avctx->block_align!\n");
return -1;
}
} }
/* decode supbackets */ /* decode supbackets */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment