[FFmpeg-cvslog] dvdsub_parse_extradata: fix memleak

Michael Niedermayer git at videolan.org
Tue Dec 10 18:59:25 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec 10 18:30:44 2013 +0100| [7fa9f7ef1c2f0cee81ec6ea6a4ff10af4c4fc62c] | committer: Michael Niedermayer

dvdsub_parse_extradata: fix memleak

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

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

 libavcodec/dvdsubdec.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 31ce0ac..637f3e6 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -599,8 +599,10 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx)
             int w, h;
             if (sscanf(data + 5, "%dx%d", &w, &h) == 2) {
                int ret = ff_set_dimensions(avctx, w, h);
-               if (ret < 0)
+               if (ret < 0) {
+                   av_free(dataorig);
                    return ret;
+               }
             }
         }
 



More information about the ffmpeg-cvslog mailing list