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

Michael Niedermayer git at videolan.org
Sat May 16 00:16:27 CEST 2015


ffmpeg | branch: release/2.6 | Michael Niedermayer <michaelni at gmx.at> | Fri May 15 22:02:12 2015 +0200| [2612b69d3f707540a8e517088c6dc520325ef42c] | committer: Michael Niedermayer

avcodec/libtheoraenc: Check for av_malloc failure

Fixes CID1257799

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit c64b2d480b4a35d4face9928b4265a0fda3f3dd9)

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

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

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

diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index b4b395a..0ccb9ec 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -111,6 +111,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;



More information about the ffmpeg-cvslog mailing list