avcodec/libtheoraenc: Check for av_malloc failure

Fixes CID1257799

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-05-15 22:02:12 +02:00
parent 228f7c7eed
commit d3c9d87eea
1 changed files with 2 additions and 0 deletions

View File

@ -108,6 +108,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;