summaryrefslogtreecommitdiff
path: root/libavcodec/libtheoraenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-22 02:11:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-22 02:11:27 +0100
commit27216bf314c62125c408be1a5a79e5c9dba88e76 (patch)
tree6e766c5689428f71c2663b17bfabcc57dead4886 /libavcodec/libtheoraenc.c
parent20f5a179560ce844c9fa7886f60d61d4e2db7480 (diff)
avcodec/libtheoraenc: Check for stats allocation failure
Fixes CID1257785 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libtheoraenc.c')
-rw-r--r--libavcodec/libtheoraenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index 4c90822439..c0074af652 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -131,6 +131,10 @@ static int submit_stats(AVCodecContext *avctx)
}
h->stats_size = strlen(avctx->stats_in) * 3/4;
h->stats = av_malloc(h->stats_size);
+ if (!h->stats) {
+ h->stats_size = 0;
+ return AVERROR(ENOMEM);
+ }
h->stats_size = av_base64_decode(h->stats, avctx->stats_in, h->stats_size);
}
while (h->stats_size - h->stats_offset > 0) {