]> git.sesse.net Git - ffmpeg/commitdiff
pngdec: set correct range
authorwm4 <nfxjfg@googlemail.com>
Thu, 7 May 2015 21:37:18 +0000 (23:37 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 7 May 2015 22:44:06 +0000 (00:44 +0200)
AV_PIX_FMT_GRAY8/16 are considered YUV formats, and the color_range is
not set - so the API user will have to assume limitted range. (Unless
the API user adds a special-case for the PNG decoder.)

Just export the correct range - full range.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pngdec.c
tests/ref/fate/png-ya16
tests/ref/fate/png-ya8

index 1f8a77b37b20ec93ff4351f814d3ae5bb2d1eb7b..72d75fba80f83f6a74b3e46890c4cf5974fee058 100644 (file)
@@ -633,6 +633,8 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s,
             return AVERROR_INVALIDDATA;
         }
 
+        avctx->color_range = AVCOL_RANGE_JPEG;
+
         if ((ret = ff_thread_get_buffer(avctx, &s->picture, AV_GET_BUFFER_FLAG_REF)) < 0)
             return ret;
         ff_thread_finish_setup(avctx);
index 07906c4a70e69285dce71d50537afde0be750b5b..dffdaf7038407676ea9b2ff19c4ff00affa9a9a5 100644 (file)
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,    49152, 0x93ce1cd5
+0,          0,          0,        1,    49152, 0x0801ce78
index 3a5c99d9eb2aee071faa8fa20b6698902de44ecd..1318af80c618e9d09cdee63899e23cc6510ae4c4 100644 (file)
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,    49152, 0xed73bf03
+0,          0,          0,        1,    49152, 0x5a1481f8