[FFmpeg-cvslog] dvdsubdec: Do not leak on failure path

2015-01-17 Thread Luca Barbato
ffmpeg | branch: release/2.4 | Luca Barbato lu_z...@gentoo.org | Sun Nov  9 
08:48:47 2014 +0100| [5891fd017aa7bed4c423b8511090cf8641a0afa4] | committer: 
Luca Barbato

dvdsubdec: Do not leak on failure path

CC: libav-sta...@libav.org
Bug-Id: CID 1198262
(cherry picked from commit d466d82faaf6e0e57a3a4be5e38e3902ef251ac3)
Signed-off-by: Luca Barbato lu_z...@gentoo.org

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

 libavcodec/dvdsubdec.c |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 5d6db41..15abac0 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -503,6 +503,7 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
 {
 DVDSubContext *ctx = avctx-priv_data;
 char *data, *cur;
+int ret = 0;
 
 if (!avctx-extradata || !avctx-extradata_size)
 return 0;
@@ -527,16 +528,18 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
 } else if (!strncmp(size:, cur, 5)) {
 int w, h;
 if (sscanf(cur + 5, %dx%d, w, h) == 2) {
-   int ret = ff_set_dimensions(avctx, w, h);
+   ret = ff_set_dimensions(avctx, w, h);
if (ret  0)
-   return ret;
+   goto fail;
 }
 }
 cur += strcspn(cur, \n\r);
 cur += strspn(cur, \n\r);
 }
+
+fail:
 av_free(data);
-return 0;
+return ret;
 }
 
 AVCodec ff_dvdsub_decoder = {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dvdsubdec: Do not leak on failure path

2014-11-21 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato lu_z...@gentoo.org | Sun Nov  9 
08:48:47 2014 +0100| [d466d82faaf6e0e57a3a4be5e38e3902ef251ac3] | committer: 
Vittorio Giovara

dvdsubdec: Do not leak on failure path

CC: libav-sta...@libav.org
Bug-Id: CID 1198262

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

 libavcodec/dvdsubdec.c |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 5d6db41..15abac0 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -503,6 +503,7 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
 {
 DVDSubContext *ctx = avctx-priv_data;
 char *data, *cur;
+int ret = 0;
 
 if (!avctx-extradata || !avctx-extradata_size)
 return 0;
@@ -527,16 +528,18 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
 } else if (!strncmp(size:, cur, 5)) {
 int w, h;
 if (sscanf(cur + 5, %dx%d, w, h) == 2) {
-   int ret = ff_set_dimensions(avctx, w, h);
+   ret = ff_set_dimensions(avctx, w, h);
if (ret  0)
-   return ret;
+   goto fail;
 }
 }
 cur += strcspn(cur, \n\r);
 cur += strspn(cur, \n\r);
 }
+
+fail:
 av_free(data);
-return 0;
+return ret;
 }
 
 AVCodec ff_dvdsub_decoder = {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog