Commit c64b2d48 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/libtheoraenc: Check for av_malloc failure

Fixes CID1257799
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e6ec65d2
......@@ -111,6 +111,8 @@ static int get_stats(AVCodecContext *avctx, int eos)
// libtheora generates a summary header at the end
memcpy(h->stats, buf, bytes);
avctx->stats_out = av_malloc(b64_size);
if (!avctx->stats_out)
return AVERROR(ENOMEM);
av_base64_encode(avctx->stats_out, b64_size, h->stats, h->stats_offset);
}
return 0;
......
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