avformat/utils: Clear pointer in ff_alloc_extradata() to avoid leaving a stale pointer in memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bbfca8e84b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-01-06 12:53:53 +01:00
parent 2791eba1d7
commit 918ed73b70
1 changed files with 1 additions and 0 deletions

View File

@ -2829,6 +2829,7 @@ int ff_alloc_extradata(AVCodecContext *avctx, int size)
int ret;
if (size < 0 || size >= INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
avctx->extradata = NULL;
avctx->extradata_size = 0;
return AVERROR(EINVAL);
}