diff mbox series

[FFmpeg-devel,2/3] avformat/rawdec: reduce randomness in used identifiers

Message ID 20200603231919.26199-2-michael@niedermayer.cc
State Accepted
Commit 71a822fa3514b82cde6701252bde0477aad21689
Headers show
Series [FFmpeg-devel,1/3] avcodec/bitpacked: , | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Michael Niedermayer June 3, 2020, 11:19 p.m. UTC
Fixes: out of array access
Fixes: 22686/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5121369624018944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/rawdec.c | 2 ++
 libavformat/rawdec.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Anton Khirnov June 5, 2020, 8:29 a.m. UTC | #1
Quoting Michael Niedermayer (2020-06-04 01:19:18)
>Subject: avformat/rawdec: reduce randomness in	used identifiers

The patch looks ok, but the commit message is not very clear. "fix
identifier names" would be easier to understand IMO.
Michael Niedermayer June 5, 2020, 10:26 p.m. UTC | #2
On Fri, Jun 05, 2020 at 10:29:23AM +0200, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2020-06-04 01:19:18)
> >Subject: avformat/rawdec: reduce randomness in	used identifiers
> 
> The patch looks ok, but the commit message is not very clear. "fix
> identifier names" would be easier to understand IMO.

will apply with the suggested message

thx

[...]
diff mbox series

Patch

diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index fee016cc7f..10c37c5cb9 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -123,6 +123,8 @@  const AVOption ff_rawvideo_options[] = {
     { "raw_packet_size", "", OFFSET(raw_packet_size), AV_OPT_TYPE_INT, {.i64 = RAW_PACKET_SIZE }, 1, INT_MAX, DEC},
     { NULL },
 };
+#undef OFFSET
+#define OFFSET(x) offsetof(FFRawDemuxerContext, x)
 const AVOption ff_raw_options[] = {
     { "raw_packet_size", "", OFFSET(raw_packet_size), AV_OPT_TYPE_INT, {.i64 = RAW_PACKET_SIZE }, 1, INT_MAX, DEC},
     { NULL },
diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h
index 85e0790c86..34c8adcb19 100644
--- a/libavformat/rawdec.h
+++ b/libavformat/rawdec.h
@@ -95,7 +95,7 @@  static const AVClass name ## _demuxer_class = {\
 };
 
 #define FF_DEF_RAWSUB_DEMUXER(shortname, longname, probe, ext, id, flag)\
-FF_RAWVIDEO_DEMUXER_CLASS(shortname)\
+FF_RAWSUB_DEMUXER_CLASS(shortname)\
 AVInputFormat ff_ ## shortname ## _demuxer = {\
     .name           = #shortname,\
     .long_name      = NULL_IF_CONFIG_SMALL(longname),\