avcodec/videotoolbox: use early return in videotoolbox_default_free
authorAman Gupta <aman@tmm1.net>
Fri, 10 Nov 2017 19:59:05 +0000 (11:59 -0800)
committerAman Gupta <aman@tmm1.net>
Mon, 13 Nov 2017 22:31:44 +0000 (14:31 -0800)
Cosmetic change only.

Signed-off-by: Aman Gupta <aman@tmm1.net>
libavcodec/videotoolbox.c

index f0790e7..5011f52 100644 (file)
@@ -849,15 +849,15 @@ static int videotoolbox_default_init(AVCodecContext *avctx)
 static void videotoolbox_default_free(AVCodecContext *avctx)
 {
     AVVideotoolboxContext *videotoolbox = videotoolbox_get_context(avctx);
+    if (!videotoolbox)
+        return;
 
-    if (videotoolbox) {
-        if (videotoolbox->cm_fmt_desc)
-            CFRelease(videotoolbox->cm_fmt_desc);
+    if (videotoolbox->cm_fmt_desc)
+        CFRelease(videotoolbox->cm_fmt_desc);
 
-        if (videotoolbox->session) {
-            VTDecompressionSessionInvalidate(videotoolbox->session);
-            CFRelease(videotoolbox->session);
-        }
+    if (videotoolbox->session) {
+        VTDecompressionSessionInvalidate(videotoolbox->session);
+        CFRelease(videotoolbox->session);
     }
 }