diff --git a/libavcodec/png.c b/libavcodec/png.c
index 6d588c35a880b206964a5998c5cdf50e3d4d8f2d..a257492b7c2b1d371605f9d14c74821cbe6753e8 100644
--- a/libavcodec/png.c
+++ b/libavcodec/png.c
@@ -567,6 +567,9 @@ static int decode_frame(AVCodecContext *avctx,
                 } else if (s->bit_depth == 8 &&
                            s->color_type == PNG_COLOR_TYPE_GRAY) {
                     avctx->pix_fmt = PIX_FMT_GRAY8;
+                } else if (s->bit_depth == 16 &&
+                           s->color_type == PNG_COLOR_TYPE_GRAY) {
+                    avctx->pix_fmt = PIX_FMT_GRAY16BE;
                 } else if (s->bit_depth == 1 &&
                            s->color_type == PNG_COLOR_TYPE_GRAY) {
                     avctx->pix_fmt = PIX_FMT_MONOBLACK;