dvdsub_parse_extradata: fix memleak
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 10 Dec 2013 17:30:44 +0000 (18:30 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 10 Dec 2013 17:30:44 +0000 (18:30 +0100)
Fixes CID1135765
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dvdsubdec.c

index 31ce0ac..637f3e6 100644 (file)
@@ -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;
+               }
             }
         }