diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-15 22:02:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-01 23:25:21 +0200 |
commit | eac07625f94c2db613eeccece02b64350bcfbe44 (patch) | |
tree | 53ac06f10809d10f8ccacee46d6760125ca946c8 | |
parent | 55ee305beba3ab749ecea9f1b86df6a903cc98de (diff) | |
download | ffmpeg-eac07625f94c2db613eeccece02b64350bcfbe44.tar.gz |
avcodec/libtheoraenc: Check for av_malloc failure
Fixes CID1257799
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c64b2d480b4a35d4face9928b4265a0fda3f3dd9)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/libtheoraenc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index 4c90822439..36d48fbbb3 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -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; |