summaryrefslogtreecommitdiff
path: root/libavcodec/dvbsubdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-10 19:18:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-10 19:21:58 +0100
commitebe3a41ea3b93579379b0460338ff511f9749602 (patch)
tree871b266a9051b3da9841c33ef492e31013592cb8 /libavcodec/dvbsubdec.c
parenta4d3cf10b2ece441ae25849a66b1c11d838f9381 (diff)
avcodec/dvbsubdec: Add some av_malloc() failure checks
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dvbsubdec.c')
-rw-r--r--libavcodec/dvbsubdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index e634c9f5be..5099852bb7 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;