Message ID | 20221113184441.1741-1-cus@passwd.hu |
---|---|
State | Accepted |
Commit | 29d1d3e2e8df603c55534ee335ddec4170e9ca93 |
Headers | show |
Series | [FFmpeg-devel,1/3] avformat/electronicarts: fix EOF check | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On Sun, Nov 13, 2022 at 07:44:39PM +0100, Marton Balint wrote: > Similar to feof(), avio_feof() is only true after an actual overread. > > Signed-off-by: Marton Balint <cus@passwd.hu> > --- > libavformat/electronicarts.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c > index e7f0cb9b9e..0a0d6249e8 100644 > --- a/libavformat/electronicarts.c > +++ b/libavformat/electronicarts.c > @@ -582,9 +582,9 @@ static int ea_read_packet(AVFormatContext *s, AVPacket *pkt) > int av_uninit(num_samples); > > while ((!packet_read && !hit_end) || partial_packet) { > + chunk_type = avio_rl32(pb); > if (avio_feof(pb)) > return AVERROR_EOF; > - chunk_type = avio_rl32(pb); > chunk_size = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb); > if (chunk_size < 8) > return AVERROR_INVALIDDATA; > -- > 2.35.3 lgtm -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index e7f0cb9b9e..0a0d6249e8 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -582,9 +582,9 @@ static int ea_read_packet(AVFormatContext *s, AVPacket *pkt) int av_uninit(num_samples); while ((!packet_read && !hit_end) || partial_packet) { + chunk_type = avio_rl32(pb); if (avio_feof(pb)) return AVERROR_EOF; - chunk_type = avio_rl32(pb); chunk_size = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb); if (chunk_size < 8) return AVERROR_INVALIDDATA;
Similar to feof(), avio_feof() is only true after an actual overread. Signed-off-by: Marton Balint <cus@passwd.hu> --- libavformat/electronicarts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)