[FFmpeg-devel] [PATCH 4/4] livavdevice/decklink: Don't allow any codecs but V210 and UYVY422

Devin Heitmueller dheitmueller at ltnglobal.com
Tue Sep 26 19:06:23 EEST 2017


Make sure that codecs other than V210 or wrapped avframes with
uyvy422 video are passed to decklink output (which would result
in undefined behavior).

Signed-off-by: Devin Heitmueller <dheitmueller at ltnglobal.com>
---
 libavdevice/decklink_enc.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp
index 0d965699ec..8f08ded933 100644
--- a/libavdevice/decklink_enc.cpp
+++ b/libavdevice/decklink_enc.cpp
@@ -159,6 +159,10 @@ static int decklink_setup_video(AVFormatContext *avctx, AVStream *st)
                    " Only AV_PIX_FMT_UYVY422 is supported.\n");
             return -1;
         }
+    } else if (c->codec_id != AV_CODEC_ID_V210) {
+        av_log(avctx, AV_LOG_ERROR, "Unsupported codec type!"
+               " Only V210 and wrapped frame with AV_PIX_FMT_UYVY422 are supported.\n");
+        return -1;
     }
 
     if (ff_decklink_set_format(avctx, c->width, c->height,
-- 
2.13.2



More information about the ffmpeg-devel mailing list