You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/libtheoraenc: Check for av_malloc failure
Fixes CID1257799 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -111,6 +111,8 @@ static int get_stats(AVCodecContext *avctx, int eos)
|
|||||||
// libtheora generates a summary header at the end
|
// libtheora generates a summary header at the end
|
||||||
memcpy(h->stats, buf, bytes);
|
memcpy(h->stats, buf, bytes);
|
||||||
avctx->stats_out = av_malloc(b64_size);
|
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);
|
av_base64_encode(avctx->stats_out, b64_size, h->stats, h->stats_offset);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user