]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/hwcontext.c
avfilter/avf_showspectrum: improve axes drawing
[ffmpeg] / libavutil / hwcontext.c
index 70c556ecacbb03e1fd649ff82cb904425b780f52..745016ed7e166cac03e47cea297ea5831e1bf877 100644 (file)
@@ -646,6 +646,9 @@ int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr,
                     ret = AVERROR(ENOMEM);
                     goto fail;
                 }
+                ret = av_hwdevice_ctx_init(dst_ref);
+                if (ret < 0)
+                    goto fail;
                 goto done;
             }
             if (ret != AVERROR(ENOSYS))
@@ -658,10 +661,6 @@ int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr,
     goto fail;
 
 done:
-    ret = av_hwdevice_ctx_init(dst_ref);
-    if (ret < 0)
-        goto fail;
-
     *dst_ref_ptr = dst_ref;
     return 0;