]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/sdr2.c
avdevice: Constify all devices
[ffmpeg] / libavformat / sdr2.c
index 50abdf9397c1d9e9d6b18c56dbc30c65eb191479..3743d59e5867324b9d5215d6a31bf53266fa83ce 100644 (file)
@@ -90,12 +90,11 @@ static int sdr2_read_packet(AVFormatContext *s, AVPacket *pkt)
     avio_skip(s->pb, 30);
 
     if (pos == FIRST) {
-        if (av_new_packet(pkt, next - 52 + 24) < 0)
-            return AVERROR(ENOMEM);
+        if ((ret = av_new_packet(pkt, next - 52 + 24)) < 0)
+            return ret;
         memcpy(pkt->data, header, 24);
         ret = avio_read(s->pb, pkt->data + 24, next - 52);
         if (ret < 0) {
-            av_packet_unref(pkt);
             return ret;
         }
         av_shrink_packet(pkt, ret + 24);