[FFmpeg-cvslog] avcodec/dvbsubdec: Add some av_malloc() failure checks

Michael Niedermayer git at videolan.org
Sat Jan 10 19:39:16 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jan 10 19:18:59 2015 +0100| [ebe3a41ea3b93579379b0460338ff511f9749602] | committer: Michael Niedermayer

avcodec/dvbsubdec: Add some av_malloc() failure checks

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

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

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

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index e634c9f..5099852 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1082,6 +1082,8 @@ static int dvbsub_parse_clut_segment(AVCodecContext *avctx,
 
     if (!clut) {
         clut = av_malloc(sizeof(DVBSubCLUT));
+        if (!clut)
+            return AVERROR(ENOMEM);
 
         memcpy(clut, &default_clut, sizeof(DVBSubCLUT));
 
@@ -1169,6 +1171,8 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
 
     if (!region) {
         region = av_mallocz(sizeof(DVBSubRegion));
+        if (!region)
+            return;
 
         region->id = region_id;
         region->version = -1;



More information about the ffmpeg-cvslog mailing list