[FFmpeg-cvslog] avcodec/videotoolbox: use early return in videotoolbox_default_free
Aman Gupta
git at videolan.org
Tue Nov 14 00:36:39 EET 2017
ffmpeg | branch: master | Aman Gupta <aman at tmm1.net> | Fri Nov 10 11:59:05 2017 -0800| [631296ff9922a6971de41640a0d937b1a2a52393] | committer: Aman Gupta
avcodec/videotoolbox: use early return in videotoolbox_default_free
Cosmetic change only.
Signed-off-by: Aman Gupta <aman at tmm1.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=631296ff9922a6971de41640a0d937b1a2a52393
---
libavcodec/videotoolbox.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index f0790e7353..5011f5201d 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -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);
}
}
More information about the ffmpeg-cvslog
mailing list