mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/fmvc: Fix use of uninitialized memory when the first frame is not a keyframe
Fixes: fmvc-poc.avi Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a1652aca7e
commit
3766aa7343
|
@ -596,8 +596,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||||
s->bpp = avctx->bits_per_coded_sample >> 3;
|
s->bpp = avctx->bits_per_coded_sample >> 3;
|
||||||
s->buffer_size = avctx->width * avctx->height * 4;
|
s->buffer_size = avctx->width * avctx->height * 4;
|
||||||
s->pbuffer_size = avctx->width * avctx->height * 4;
|
s->pbuffer_size = avctx->width * avctx->height * 4;
|
||||||
s->buffer = av_malloc(s->buffer_size);
|
s->buffer = av_mallocz(s->buffer_size);
|
||||||
s->pbuffer = av_malloc(s->pbuffer_size);
|
s->pbuffer = av_mallocz(s->pbuffer_size);
|
||||||
if (!s->buffer || !s->pbuffer)
|
if (!s->buffer || !s->pbuffer)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue