Skip to content
Permalink
Browse files Browse the repository at this point in the history
avcodec/xwddec: Check bpp more completely
Fixes out of array access
Fixes: 1399/clusterfuzz-testcase-minimized-4866094172995584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
michaelni committed May 7, 2017
1 parent a5e0dbf commit 441026f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libavcodec/xwddec.c
Expand Up @@ -157,9 +157,9 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
case XWD_GRAY_SCALE:
if (bpp != 1 && bpp != 8)
return AVERROR_INVALIDDATA;
if (pixdepth == 1) {
if (bpp == 1 && pixdepth == 1) {
avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
} else if (pixdepth == 8) {
} else if (bpp == 8 && pixdepth == 8) {
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
}
break;
Expand Down

0 comments on commit 441026f

Please sign in to comment.