summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-15 22:02:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 02:13:12 +0200
commit13b22617c185e69f3d1ada5544f1512acb0777bd (patch)
treefe8fe19c8b4b5422c5725c2cdfc2ace74a875c8d
parentc01f5517280c389cd823e9e1b5d1cf979040bd61 (diff)
downloadffmpeg-13b22617c185e69f3d1ada5544f1512acb0777bd.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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index a2e5b74cb6..3a0a736b59 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -113,6 +113,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;