]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pngdec.c
hevc_filter: drop redundant checks
[ffmpeg] / libavcodec / pngdec.c
index 7bc2ad484798698b21f0a28f40034a8cd1952f1e..fa7f7cc0a62a01028ee6ca8a6d816c850fbad89c 100644 (file)
@@ -240,7 +240,7 @@ static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
             p      = last[i];
             dst[i] = p + src[i];
         }
-        if (bpp > 1 && size > 4) {
+        if (bpp > 2 && size > 4) {
             /* would write off the end of the array if we let it process
              * the last pixel with bpp=3 */
             int w = bpp == 4 ? size : size - 3;
@@ -500,6 +500,9 @@ static int decode_frame(AVCodecContext *avctx,
                 } else if (s->bit_depth == 8 &&
                            s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
                     avctx->pix_fmt = AV_PIX_FMT_YA8;
+                } else if (s->bit_depth == 16 &&
+                           s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
+                    avctx->pix_fmt = AV_PIX_FMT_YA16BE;
                 } else {
                     goto fail;
                 }