Unified · Split
| @@ -183,15 +183,14 @@ static int evc_read_packet(AVFormatContext *s, AVPacket *pkt) · 182 unmodified lines | |||
| 183 | int ret; | 183 | int ret; |
| 184 | int32_t nalu_size; | 184 | int32_t nalu_size; |
| 185 | int au_end_found = 0; | 185 | int au_end_found = 0; |
| 186 | |||
| 187 | EVCDemuxContext *const c = s->priv_data; | 186 | EVCDemuxContext *const c = s->priv_data; |
| 188 | 187 | ||
| 189 | if (avio_feof(s->pb)) | ||
| 190 | return AVERROR_EOF; | ||
| 191 | |||
| 192 | while(!au_end_found) { | 188 | while(!au_end_found) { |
| 193 | uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE]; | 189 | uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE]; |
| 194 | 190 | ||
| 191 | if (avio_feof(s->pb)) | ||
| 192 | goto end; | ||
| 193 | |||
| 195 | ret = ffio_ensure_seekback(s->pb, EVC_NALU_LENGTH_PREFIX_SIZE); | 194 | ret = ffio_ensure_seekback(s->pb, EVC_NALU_LENGTH_PREFIX_SIZE); |
| 196 | if (ret < 0) | 195 | if (ret < 0) |
| 197 | return ret; | 196 | return ret; |
| @@ -212,6 +211,7 @@ static int evc_read_packet(AVFormatContext *s, AVPacket *pkt) · 14 unmodified lines | |||
| 212 | if (ret != (nalu_size + EVC_NALU_LENGTH_PREFIX_SIZE)) | 211 | if (ret != (nalu_size + EVC_NALU_LENGTH_PREFIX_SIZE)) |
| 213 | return AVERROR_INVALIDDATA; | 212 | return AVERROR_INVALIDDATA; |
| 214 | 213 | ||
| 214 | end: | ||
| 215 | ret = av_bsf_send_packet(c->bsf, pkt); | 215 | ret = av_bsf_send_packet(c->bsf, pkt); |
| 216 | if (ret < 0) { | 216 | if (ret < 0) { |
| 217 | av_log(s, AV_LOG_ERROR, "Failed to send packet to " | 217 | av_log(s, AV_LOG_ERROR, "Failed to send packet to " |