summaryrefslogtreecommitdiff
path: root/libavcodec/dirac.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-02-09 14:46:45 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-02-09 14:59:36 +0100
commit43a69655699bb115df6c760e14dbe319ac38e0cd (patch)
treeb5253c257933de93577ea40920372abf2d04d54d /libavcodec/dirac.c
parent020b75806f6e113630846a5bccece8cefb23626a (diff)
downloadffmpeg-43a69655699bb115df6c760e14dbe319ac38e0cd.tar.gz
avcodec/dirac: Fix memleak of dsh on error
Fixes CID1351360 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dirac.c')
-rw-r--r--libavcodec/dirac.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c
index 39df2a8847..527f015e11 100644
--- a/libavcodec/dirac.c
+++ b/libavcodec/dirac.c
@@ -349,8 +349,10 @@ int av_dirac_parse_sequence_header(AVDiracSeqHeader **pdsh,
else if (dsh->version.major > 2 && log_ctx)
av_log(log_ctx, AV_LOG_WARNING, "Stream may have unhandled features\n");
- if (video_format > 20U)
- return AVERROR_INVALIDDATA;
+ if (video_format > 20U) {
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
/* Fill in defaults for the source parameters. */
dsh->width = dirac_source_parameters_defaults[video_format].width;