mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 16:22:37 +00:00
avformat/lmlm4: Eliminate some AVERROR(EIO)
Found by code review related to CID732224 Overflowed constant Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
239f7e6c71
commit
191a685010
@ -94,16 +94,16 @@ static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
|
|
||||||
if (frame_type > LMLM4_MPEG1L2 || frame_type == LMLM4_INVALID) {
|
if (frame_type > LMLM4_MPEG1L2 || frame_type == LMLM4_INVALID) {
|
||||||
av_log(s, AV_LOG_ERROR, "invalid or unsupported frame_type\n");
|
av_log(s, AV_LOG_ERROR, "invalid or unsupported frame_type\n");
|
||||||
return AVERROR(EIO);
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
if (packet_size > LMLM4_MAX_PACKET_SIZE || packet_size<=8) {
|
if (packet_size > LMLM4_MAX_PACKET_SIZE || packet_size<=8) {
|
||||||
av_log(s, AV_LOG_ERROR, "packet size %d is invalid\n", packet_size);
|
av_log(s, AV_LOG_ERROR, "packet size %d is invalid\n", packet_size);
|
||||||
return AVERROR(EIO);
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
frame_size = packet_size - 8;
|
frame_size = packet_size - 8;
|
||||||
if ((ret = av_get_packet(pb, pkt, frame_size)) <= 0)
|
if ((ret = av_get_packet(pb, pkt, frame_size)) <= 0)
|
||||||
return AVERROR(EIO);
|
return ret < 0 ? ret : AVERROR(EIO);
|
||||||
|
|
||||||
avio_skip(pb, padding);
|
avio_skip(pb, padding);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user