[FFmpeg-devel,1/2] avcodec/huffyuv: remove gray8a (the format is listed but not supported by the implementation)

Submitted by Michael Niedermayer on July 3, 2019, 10:37 p.m.

Details

Message ID 20190703223755.6319-1-michael@niedermayer.cc
State Accepted
Commit 6aaa01afe4fb774d0767684aa00f075b0ee5fca6
Headers show

Commit Message

Michael Niedermayer July 3, 2019, 10:37 p.m.
Fixes: null pointer dereference
Fixes: 15464/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5681391150301184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/huffyuvdec.c | 3 ---
 libavcodec/huffyuvenc.c | 2 --
 2 files changed, 5 deletions(-)

Comments

Paul B Mahol July 12, 2019, 8:41 a.m.
LGTM

On 7/4/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes: null pointer dereference
> Fixes:
> 15464/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5681391150301184
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/huffyuvdec.c | 3 ---
>  libavcodec/huffyuvenc.c | 2 --
>  2 files changed, 5 deletions(-)
>
> diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
> index 27f650d7bf..771481fd03 100644
> --- a/libavcodec/huffyuvdec.c
> +++ b/libavcodec/huffyuvdec.c
> @@ -418,9 +418,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
>          case 0x0F0:
>              avctx->pix_fmt = AV_PIX_FMT_GRAY16;
>              break;
> -        case 0x170:
> -            avctx->pix_fmt = AV_PIX_FMT_GRAY8A;
> -            break;
>          case 0x470:
>              avctx->pix_fmt = AV_PIX_FMT_GBRP;
>              break;
> diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
> index 3662c173ec..a6f0d06445 100644
> --- a/libavcodec/huffyuvenc.c
> +++ b/libavcodec/huffyuvenc.c
> @@ -268,7 +268,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
>      case AV_PIX_FMT_YUVA420P:
>      case AV_PIX_FMT_YUVA422P:
>      case AV_PIX_FMT_GBRAP:
> -    case AV_PIX_FMT_GRAY8A:
>      case AV_PIX_FMT_YUV420P9:
>      case AV_PIX_FMT_YUV420P10:
>      case AV_PIX_FMT_YUV420P12:
> @@ -1122,7 +1121,6 @@ AVCodec ff_ffvhuff_encoder = {
>          AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
>          AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
>          AV_PIX_FMT_GBRAP,
> -        AV_PIX_FMT_GRAY8A,
>          AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12,
> AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV420P16,
>          AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12,
> AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV422P16,
>          AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12,
> AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV444P16,
> --
> 2.22.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Michael Niedermayer July 12, 2019, 6:42 p.m.
On Fri, Jul 12, 2019 at 10:41:19AM +0200, Paul B Mahol wrote:
> LGTM

will apply

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 27f650d7bf..771481fd03 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -418,9 +418,6 @@  static av_cold int decode_init(AVCodecContext *avctx)
         case 0x0F0:
             avctx->pix_fmt = AV_PIX_FMT_GRAY16;
             break;
-        case 0x170:
-            avctx->pix_fmt = AV_PIX_FMT_GRAY8A;
-            break;
         case 0x470:
             avctx->pix_fmt = AV_PIX_FMT_GBRP;
             break;
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index 3662c173ec..a6f0d06445 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -268,7 +268,6 @@  FF_ENABLE_DEPRECATION_WARNINGS
     case AV_PIX_FMT_YUVA420P:
     case AV_PIX_FMT_YUVA422P:
     case AV_PIX_FMT_GBRAP:
-    case AV_PIX_FMT_GRAY8A:
     case AV_PIX_FMT_YUV420P9:
     case AV_PIX_FMT_YUV420P10:
     case AV_PIX_FMT_YUV420P12:
@@ -1122,7 +1121,6 @@  AVCodec ff_ffvhuff_encoder = {
         AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
         AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
         AV_PIX_FMT_GBRAP,
-        AV_PIX_FMT_GRAY8A,
         AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV420P16,
         AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV422P16,
         AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV444P16,