[FFmpeg-cvslog] avcodec/libtheoraenc: Check for stats allocation failure

Michael Niedermayer git at videolan.org
Sun Feb 22 02:37:01 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 22 02:11:27 2015 +0100| [27216bf314c62125c408be1a5a79e5c9dba88e76] | committer: Michael Niedermayer

avcodec/libtheoraenc: Check for stats allocation failure

Fixes CID1257785

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=27216bf314c62125c408be1a5a79e5c9dba88e76
---

 libavcodec/libtheoraenc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index 4c90822..c0074af 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) {



More information about the ffmpeg-cvslog mailing list