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>
This commit is contained in:
Marton Balint 2022-11-13 03:51:05 +01:00
parent abb5ff373d
commit 29d1d3e2e8

View File

@ -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;