Message ID | 20190531214220.52436-1-andreas.rheinhardt@gmail.com |
---|---|
State | Superseded |
Headers | show |
Am Fr., 31. Mai 2019 um 23:43 Uhr schrieb Andreas Rheinhardt <andreas.rheinhardt@gmail.com>: > > The variables huffcount, rsrc_size and data_size were all set but not > used. Therefore they have been removed. The entailed a chance to > compactify calls to avio_skip; it has been used. > This fixes -Wunused-but-set-variable warnings in GCC. > > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> > --- > My earlier patch [1] forgot to compactify the calls to avio_skip. > The loss of information regarding the offsets of certain fields > doesn't seem important to me. I don't maintain this file but I would prefer a variant where the fields would be kept in comments to simplify future debugging (which implies to compacting). Carl Eugen
diff --git a/libavformat/hcom.c b/libavformat/hcom.c index 0d1736b620..8152ee3052 100644 --- a/libavformat/hcom.c +++ b/libavformat/hcom.c @@ -38,17 +38,11 @@ static int hcom_probe(const AVProbeData *p) static int hcom_read_header(AVFormatContext *s) { AVStream *st; - unsigned data_size, rsrc_size, huffcount; unsigned compresstype, divisor; unsigned dict_entries; int ret; - avio_skip(s->pb, 83); - data_size = avio_rb32(s->pb); - rsrc_size = avio_rb32(s->pb); - avio_skip(s->pb, 128-91+4); - huffcount = avio_rb32(s->pb); - avio_skip(s->pb, 4); + avio_skip(s->pb, 128 + 12); compresstype = avio_rb32(s->pb); if (compresstype > 1) return AVERROR_INVALIDDATA;
The variables huffcount, rsrc_size and data_size were all set but not used. Therefore they have been removed. The entailed a chance to compactify calls to avio_skip; it has been used. This fixes -Wunused-but-set-variable warnings in GCC. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- My earlier patch [1] forgot to compactify the calls to avio_skip. The loss of information regarding the offsets of certain fields doesn't seem important to me. [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-May/244001.html libavformat/hcom.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)