]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/src_movie.c
Merge commit '3f5c99fcbb2c366d7bdef8500c19f43a33bdb6b9'
[ffmpeg] / libavfilter / src_movie.c
index bbdcbc8cd0b2c6c9c3839be097f3131955bca995..82d2bcda10b8e1e181dd8f816f6418ce969d807e 100644 (file)
@@ -333,7 +333,7 @@ static int movie_query_formats(AVFilterContext *ctx)
     MovieContext *movie = ctx->priv;
     int list[] = { 0, -1 };
     int64_t list64[] = { 0, -1 };
-    int i;
+    int i, ret;
 
     for (i = 0; i < ctx->nb_outputs; i++) {
         MovieStream *st = &movie->st[i];
@@ -343,16 +343,20 @@ static int movie_query_formats(AVFilterContext *ctx)
         switch (c->codec_type) {
         case AVMEDIA_TYPE_VIDEO:
             list[0] = c->pix_fmt;
-            ff_formats_ref(ff_make_format_list(list), &outlink->in_formats);
+            if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->in_formats)) < 0)
+                return ret;
             break;
         case AVMEDIA_TYPE_AUDIO:
             list[0] = c->sample_fmt;
-            ff_formats_ref(ff_make_format_list(list), &outlink->in_formats);
+            if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->in_formats)) < 0)
+                return ret;
             list[0] = c->sample_rate;
-            ff_formats_ref(ff_make_format_list(list), &outlink->in_samplerates);
+            if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->in_samplerates)) < 0)
+                return ret;
             list64[0] = c->channel_layout;
-            ff_channel_layouts_ref(avfilter_make_format64_list(list64),
-                                   &outlink->in_channel_layouts);
+            if ((ret = ff_channel_layouts_ref(avfilter_make_format64_list(list64),
+                                   &outlink->in_channel_layouts)) < 0)
+                return ret;
             break;
         }
     }
@@ -486,7 +490,7 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
     pkt_out_id = pkt->stream_index > movie->max_stream_index ? -1 :
                  movie->out_index[pkt->stream_index];
     if (pkt_out_id < 0) {
-        av_free_packet(&movie->pkt0);
+        av_packet_unref(&movie->pkt0);
         pkt->size = 0; /* ready for next run */
         pkt->data = NULL;
         return 0;
@@ -513,7 +517,7 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
     if (ret < 0) {
         av_log(ctx, AV_LOG_WARNING, "Decode error: %s\n", av_err2str(ret));
         av_frame_free(&frame);
-        av_free_packet(&movie->pkt0);
+        av_packet_unref(&movie->pkt0);
         movie->pkt.size = 0;
         movie->pkt.data = NULL;
         return 0;
@@ -524,7 +528,7 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
     pkt->data += ret;
     pkt->size -= ret;
     if (pkt->size <= 0) {
-        av_free_packet(&movie->pkt0);
+        av_packet_unref(&movie->pkt0);
         pkt->size = 0; /* ready for next run */
         pkt->data = NULL;
     }