avformat/electronicarts: fix EOF check

Similar to feof(), avio_feof() is only true after an actual overread.

Signed-off-by: Marton Balint <cus@passwd.hu>
pull/388/head
Marton Balint 2 years ago
parent abb5ff373d
commit 29d1d3e2e8
  1. 2
      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;

Loading…
Cancel
Save