]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mxfdec.c
lavf/hlsenc: fix memory leak
[ffmpeg] / libavformat / mxfdec.c
index bb72fb9841673e2a9aa22dd480827b3914fe90ec..397f820b3f8f077f4164cd2d6bd64dac7b71a28e 100644 (file)
@@ -3508,8 +3508,8 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
                 } else {
                     if ((size = next_ofs - pos) <= 0) {
                         av_log(s, AV_LOG_ERROR, "bad size: %"PRId64"\n", size);
-                        ret = AVERROR_INVALIDDATA;
-                        goto skip;
+                        mxf->current_klv_data = (KLVPacket){{0}};
+                        return AVERROR_INVALIDDATA;
                     }
                     // We must not overread, because the next edit unit might be in another KLV
                     if (size > max_data_size)