summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-05-02 01:55:34 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-05-06 00:22:23 +0200
commit5cc378cc466121fc9de1657ea76deeba9f92089a (patch)
tree55fd48a55958289efbf06906669984417868a2b6 /libavcodec
parented3691338b25108517d354dda7f6c930fec5471c (diff)
downloadffmpeg-5cc378cc466121fc9de1657ea76deeba9f92089a.tar.gz
avcodec/pdvdec: Check previous frame before using it
Fixes: load of null pointer of type 'uint8_t' (aka 'unsigned char') Fixes: 58256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PDV_fuzzer-4776436325285888 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/pdvdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pdvdec.c b/libavcodec/pdvdec.c
index 3ac2f98b3d..d50c4e729c 100644
--- a/libavcodec/pdvdec.c
+++ b/libavcodec/pdvdec.c
@@ -93,7 +93,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
return AVERROR_INVALIDDATA;
}
- if (!(avpkt->flags & AV_PKT_FLAG_KEY)) {
+ if (prev && !(avpkt->flags & AV_PKT_FLAG_KEY)) {
for (int j = 0; j < (avctx->width + 7) >> 3; j++)
dst[j] ^= prev[j];
prev += prev_frame->linesize[0];