diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index ff0065aff7..70ce25d4eb 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -492,7 +492,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt) } else if (!ffstream(s1->streams[0])->parser) { size[0] = avio_size(s1->pb); } else { - size[0] = 4096; + size[0]= avio_size(f[0]); } } @@ -550,15 +550,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt) } if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) { - if (ret[0] < 0) { - res = ret[0]; - } else if (ret[1] < 0) { - res = ret[1]; - } else if (ret[2] < 0) { - res = ret[2]; - } else { - res = AVERROR_EOF; - } + res = AVERROR_EOF; goto fail; } else { s->img_count++;