Make sure we don't repeatedly try to decode the same packet, making no progress and possibly causing an infinite loop.
Unified · Split
| @@ -325,7 +325,7 @@ again: · 324 unmodified lines | ||
| 325 | 325 | if (s->ch_offset == 0) { |
| 326 | 326 | frame->nb_samples = s->frame_len; |
| 327 | 327 | if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) |
| 328 | − return ret; | |
| 328 | + goto fail; | |
| 329 | 329 | if (!new_pkt) |
| 330 | 330 | frame->pts = AV_NOPTS_VALUE; |
| 331 | 331 | } |
| @@ -334,8 +334,8 @@ again: · 2 unmodified lines | ||
| 334 | 334 | avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT, |
| 335 | 335 | FFMIN(MAX_CHANNELS, s->channels - s->ch_offset), s->ch_offset)) { |
| 336 | 336 | av_log(avctx, AV_LOG_ERROR, "Incomplete packet\n"); |
| 337 | − s->ch_offset = 0; | |
| 338 | − return AVERROR_INVALIDDATA; | |
| 337 | + ret = AVERROR_INVALIDDATA; | |
| 338 | + goto fail; | |
| 339 | 339 | } |
| 340 | 340 | s->ch_offset += MAX_CHANNELS; |
| 341 | 341 | get_bits_align32(gb); |