History

avformat/mpeg: Check avio_read() return value in get_pts()

Michael Niedermayer committed 6 years ago

Commit e8a88a11 parent d08c3f51 file · +4 −1Browse files

Unified · Split

libavformat/mpeg.c+4−1
@@ -147,9 +147,12 @@ static int mpegps_read_header(AVFormatContext *s) · 146 unmodified lines
147static int64_t get_pts(AVIOContext *pb, int c)147static int64_t get_pts(AVIOContext *pb, int c)
148{148{
149 uint8_t buf[5];149 uint8_t buf[5];
150 int ret;
150 151
151 buf[0] = c < 0 ? avio_r8(pb) : c;152 buf[0] = c < 0 ? avio_r8(pb) : c;
152 avio_read(pb, buf + 1, 4);153 ret = avio_read(pb, buf + 1, 4);
154 if (ret < 4)
155 return AV_NOPTS_VALUE;
153 156
154 return ff_parse_pes_pts(buf);157 return ff_parse_pes_pts(buf);
155}158}

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