summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-12-13 17:53:31 +0100
committerAnton Khirnov <anton@khirnov.net>2012-12-19 22:32:54 +0100
commit582368626188c070d4300913c6da5efa4c24cfb2 (patch)
tree8a771209f80fe16a9d19dc82239988dc55db7f35 /libavcodec/mpeg12.c
parentc661cb6672af5ebcb900ec8766b24761bd2ab011 (diff)
mpeg12: do not decode extradata more than once.
Fixes CVE-2012-2803. CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 83069f54cc..7a9b54a789 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2456,8 +2456,9 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
s->slice_count = 0;
- if (avctx->extradata && !avctx->frame_number) {
+ if (avctx->extradata && !s->extradata_decoded) {
int ret = decode_chunks(avctx, picture, got_output, avctx->extradata, avctx->extradata_size);
+ s->extradata_decoded = 1;
if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return ret;
}