]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/asfdec_o.c
vf_ssim: x86 simd for ssim_4x4xN and ssim_endN.
[ffmpeg] / libavformat / asfdec_o.c
index 90e5c7e2936015e0cf9cc2db4908a5538fd101c7..b85e2f7ad019f82981185e31a0a5a62064157e1b 100644 (file)
@@ -281,8 +281,10 @@ static int asf_read_value(AVFormatContext *s, uint8_t *name, uint16_t name_len,
             av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
     } else {
         char buf[256];
-        if (val_len > sizeof(buf))
-            return AVERROR_INVALIDDATA;
+        if (val_len > sizeof(buf)) {
+            ret = AVERROR_INVALIDDATA;
+            goto failed;
+        }
         if ((ret = avio_read(pb, value, val_len)) < 0)
             goto failed;
         if (ret < 2 * val_len)
@@ -404,8 +406,10 @@ static int asf_read_picture(AVFormatContext *s, int len)
     }
     asf->asf_st[asf->nb_streams] = av_mallocz(sizeof(*asf_st));
     asf_st = asf->asf_st[asf->nb_streams];
-    if (!asf_st)
-        return AVERROR(ENOMEM);
+    if (!asf_st) {
+        ret = AVERROR(ENOMEM);
+        goto fail;
+    }
 
     st->disposition              |= AV_DISPOSITION_ATTACHED_PIC;
     st->codec->codec_type         = asf_st->type = AVMEDIA_TYPE_VIDEO;
@@ -752,7 +756,7 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable *
     switch (type) {
     case AVMEDIA_TYPE_AUDIO:
         asf_st->type = AVMEDIA_TYPE_AUDIO;
-        if ((ret = ff_get_wav_header(pb, st->codec, ts_data_len, 0)) < 0)
+        if ((ret = ff_get_wav_header(s, pb, st->codec, ts_data_len, 0)) < 0)
             return ret;
         break;
     case AVMEDIA_TYPE_VIDEO:
@@ -1558,12 +1562,10 @@ static int asf_read_seek(AVFormatContext *s, int stream_index,
     } else {
         if ((ret = ff_seek_frame_binary(s, stream_index, timestamp, flags)) < 0)
             return ret;
-
-        // asf_read_timestamp is called inside ff_seek_frame_binary and leaves state dirty,
-        // so reset_packet_state have to be called after it.
-        reset_packet_state(s);
     }
 
+    reset_packet_state(s);
+
     return 0;
 }