summaryrefslogtreecommitdiff
path: root/libavcodec/dirac.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-01-22 17:07:16 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2016-01-22 17:15:00 +0000
commitce855bf43bcb3e217266653281db63c94e34c700 (patch)
tree736af607b4e992a3ecd4e740a2c7c553afb1ae9f /libavcodec/dirac.c
parent8a5d4a51fff7e80ea41b56dc7c15fe960ec3765c (diff)
downloadffmpeg-ce855bf43bcb3e217266653281db63c94e34c700.tar.gz
diracdec: fix full range videos
Full range video had been broken by the introduction of the < 2U check at the following line. The bitstream format kind of implies that the full and limited ranges use different pix_fmts but that's incorrect since we have the avctx->color_range flag. So adjust the pixel range index to be mapped to the same pix_fmts as limited range index. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/dirac.c')
-rw-r--r--libavcodec/dirac.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c
index faf5534e88..39df2a8847 100644
--- a/libavcodec/dirac.c
+++ b/libavcodec/dirac.c
@@ -262,6 +262,9 @@ static int parse_source_parameters(AVDiracSeqHeader *dsh, GetBitContext *gb,
dsh->bit_depth = luma_depth;
+ /* Full range 8 bts uses the same pix_fmts as limited range 8 bits */
+ dsh->pixel_range_index += dsh->pixel_range_index == 1;
+
if (dsh->pixel_range_index < 2U)
return AVERROR_INVALIDDATA;