diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-09 21:48:31 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-10 16:04:26 +0200 |
commit | 5367c59d680d3a63eb269b0b8705c5072dd56fbb (patch) | |
tree | eb130876c962ea2cc2ad686e37e6aa9f11971a90 | |
parent | 424f434c56e799d8e943200408870e499e244c8b (diff) | |
download | ffmpeg-5367c59d680d3a63eb269b0b8705c5072dd56fbb.tar.gz |
avformat/avidec: dv does not support palettes
Fixes: memleak
Fixes: 26937/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-5763003338981376
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1b373b41d940e3058cdfb3d17703e23ed665353c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/avidec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 9ed167ae6a..cff1ab0dea 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1427,6 +1427,7 @@ resync: if (avi->stream_index >= 0) { AVStream *st = s->streams[avi->stream_index]; AVIStream *ast = st->priv_data; + int dv_demux = CONFIG_DV_DEMUXER && avi->dv_demux; int size, err; if (get_subtitle_pkt(s, st, pkt)) @@ -1449,7 +1450,7 @@ resync: return err; size = err; - if (ast->has_pal && pkt->size < (unsigned)INT_MAX / 2) { + if (ast->has_pal && pkt->size < (unsigned)INT_MAX / 2 && !dv_demux) { uint8_t *pal; pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE, @@ -1463,7 +1464,7 @@ resync: } } - if (CONFIG_DV_DEMUXER && avi->dv_demux) { + if (dv_demux) { AVBufferRef *avbuf = pkt->buf; size = avpriv_dv_produce_packet(avi->dv_demux, pkt, pkt->data, pkt->size, pkt->pos); |