]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/flic.c
avformat/mux: Only prepare input packet if there is a packet
[ffmpeg] / libavformat / flic.c
index d2a5cf995c2adf2148e589aa6420f31e96be1ea2..e65c157777d4a182e583e094a9a45ef7b1824811 100644 (file)
@@ -225,7 +225,6 @@ static int flic_read_packet(AVFormatContext *s,
             ret = avio_read(pb, pkt->data + FLIC_PREAMBLE_SIZE,
                 size - FLIC_PREAMBLE_SIZE);
             if (ret != size - FLIC_PREAMBLE_SIZE) {
-                av_packet_unref(pkt);
                 ret = AVERROR(EIO);
             }
             packet_read = 1;
@@ -241,8 +240,8 @@ static int flic_read_packet(AVFormatContext *s,
             ret = avio_read(pb, pkt->data, size);
 
             if (ret != size) {
-                av_packet_unref(pkt);
                 ret = AVERROR(EIO);
+                break;
             }
 
             packet_read = 1;