History

avformat/lmlm4: Move subtraction after check

This is not a bugfix in code but coverity only, it does look a little nicer though Fixes: CID732224

Michael Niedermayer committed 2 years ago

Commit 239f7e61 parent e25667f1 file · +1 −1Browse files

Unified · Split

libavformat/lmlm4.c+1−1
@@ -91,7 +91,6 @@ static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) · 90 unmodified lines
91 frame_type = avio_rb16(pb);91 frame_type = avio_rb16(pb);
92 packet_size = avio_rb32(pb);92 packet_size = avio_rb32(pb);
93 padding = -packet_size & 511;93 padding = -packet_size & 511;
94 frame_size = packet_size - 8;
95 94
96 if (frame_type > LMLM4_MPEG1L2 || frame_type == LMLM4_INVALID) {95 if (frame_type > LMLM4_MPEG1L2 || frame_type == LMLM4_INVALID) {
97 av_log(s, AV_LOG_ERROR, "invalid or unsupported frame_type\n");96 av_log(s, AV_LOG_ERROR, "invalid or unsupported frame_type\n");
@@ -102,6 +101,7 @@ static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) · 4 unmodified lines
102 return AVERROR(EIO);101 return AVERROR(EIO);
103 }102 }
104 103
104 frame_size = packet_size - 8;
105 if ((ret = av_get_packet(pb, pkt, frame_size)) <= 0)105 if ((ret = av_get_packet(pb, pkt, frame_size)) <= 0)
106 return AVERROR(EIO);106 return AVERROR(EIO);
107 107

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t