Unified · Split
| @@ -147,9 +147,12 @@ static int mpegps_read_header(AVFormatContext *s) · 146 unmodified lines | |||
| 147 | static int64_t get_pts(AVIOContext *pb, int c) | 147 | static 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 | } |