utils: Check for extradata size overflows.

This commit is contained in:
Alex Converse
2012-01-12 11:12:24 -08:00
parent 81dc6a2a3c
commit 4df30f7114
3 changed files with 13 additions and 1 deletions

View File

@@ -610,6 +610,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
int ret = 0;
AVDictionary *tmp = NULL;
if (avctx->extradata_size < 0 || avctx->extradata_size >= FF_MAX_EXTRADATA_SIZE)
return AVERROR(EINVAL);
if (options)
av_dict_copy(&tmp, *options, 0);