Commit 0b25c3b6 authored by Anton Khirnov's avatar Anton Khirnov Committed by Reinhard Tartler

mpeg12: do not decode extradata more than once.

Fixes CVE-2012-2803.

(cherry picked from commit 58236862)
(cherry picked from commit 30176179)

Conflicts:

	libavcodec/mpeg12.c
parent b9500bf8
......@@ -1163,6 +1163,7 @@ typedef struct Mpeg1Context {
int save_width, save_height;
AVRational frame_rate_ext; ///< MPEG-2 specific framerate modificator
int extradata_decoded;
} Mpeg1Context;
static av_cold int mpeg_decode_init(AVCodecContext *avctx)
......@@ -2299,8 +2300,10 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
s->slice_count= 0;
if(avctx->extradata && !avctx->frame_number)
if (avctx->extradata && !s->extradata_decoded) {
decode_chunks(avctx, picture, data_size, avctx->extradata, avctx->extradata_size);
s->extradata_decoded = 1;
}
return decode_chunks(avctx, picture, data_size, buf, buf_size);
}
......
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