mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-28 19:22:02 +08:00
vformat/id3v2: check avio_read for short reads in addition to errors
Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -667,7 +667,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
|
|||||||
unsigned long dlen;
|
unsigned long dlen;
|
||||||
|
|
||||||
if (isv34) {
|
if (isv34) {
|
||||||
if (avio_read(s->pb, tag, 4) < 0)
|
if (avio_read(s->pb, tag, 4) < 4)
|
||||||
break;
|
break;
|
||||||
tag[4] = 0;
|
tag[4] = 0;
|
||||||
if (version == 3) {
|
if (version == 3) {
|
||||||
@@ -677,7 +677,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
|
|||||||
tflags = avio_rb16(s->pb);
|
tflags = avio_rb16(s->pb);
|
||||||
tunsync = tflags & ID3v2_FLAG_UNSYNCH;
|
tunsync = tflags & ID3v2_FLAG_UNSYNCH;
|
||||||
} else {
|
} else {
|
||||||
if (avio_read(s->pb, tag, 3) < 0)
|
if (avio_read(s->pb, tag, 3) < 3)
|
||||||
break;
|
break;
|
||||||
tag[3] = 0;
|
tag[3] = 0;
|
||||||
tlen = avio_rb24(s->pb);
|
tlen = avio_rb24(s->pb);
|
||||||
|
|||||||
Reference in New Issue
Block a user