aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cuvid.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2016-09-14 19:56:08 -0700
committerTimo Rothenpieler <timo@rothenpieler.org>2016-09-17 14:08:58 +0200
commitee88dcb2b0fefb42b0761ddb105c71daf604d791 (patch)
treee0457a7d049878270535d855f058a055c4e3de66 /libavcodec/cuvid.c
parent8a066697023e3eab3fc6c2bccc5bd0adb07f4579 (diff)
downloadffmpeg-ee88dcb2b0fefb42b0761ddb105c71daf604d791.tar.gz
avcodec/cuvid: Check for non 420 chroma formats - they aren't supported
Despite the video parser seeming to correctly handle 422 and 444 chroma formats, the video decoder fails miserably to actually decode frames - even though no errors are ever returned; you just get frames showing unintialized garbage. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/cuvid.c')
-rw-r--r--libavcodec/cuvid.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/cuvid.c b/libavcodec/cuvid.c
index 131000591e..540f2b758b 100644
--- a/libavcodec/cuvid.c
+++ b/libavcodec/cuvid.c
@@ -137,6 +137,12 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
return 0;
}
+ if (format->chroma_format != cudaVideoChromaFormat_420) {
+ av_log(avctx, AV_LOG_ERROR, "Chroma formats other than 420 are not supported\n");
+ ctx->internal_error = AVERROR(EINVAL);
+ return 0;
+ }
+
avctx->coded_width = format->coded_width;
avctx->coded_height = format->coded_height;