History

lavc/binkaudio: reset input packet on errors

Make sure we don't repeatedly try to decode the same packet, making no progress and possibly causing an infinite loop.

Anton Khirnov committed 3 years ago

Commit 593e8c21 parent f2349e71 file · +3 −3Browse files

Unified · Split

libavcodec/binkaudio.c+3−3
@@ -325,7 +325,7 @@ again: · 324 unmodified lines
325 if (s->ch_offset == 0) {325 if (s->ch_offset == 0) {
326 frame->nb_samples = s->frame_len;326 frame->nb_samples = s->frame_len;
327 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)327 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
328 return ret;328 goto fail;
329 if (!new_pkt)329 if (!new_pkt)
330 frame->pts = AV_NOPTS_VALUE;330 frame->pts = AV_NOPTS_VALUE;
331 }331 }
@@ -334,8 +334,8 @@ again: · 2 unmodified lines
334 avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT,334 avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT,
335 FFMIN(MAX_CHANNELS, s->channels - s->ch_offset), s->ch_offset)) {335 FFMIN(MAX_CHANNELS, s->channels - s->ch_offset), s->ch_offset)) {
336 av_log(avctx, AV_LOG_ERROR, "Incomplete packet\n");336 av_log(avctx, AV_LOG_ERROR, "Incomplete packet\n");
337 s->ch_offset = 0;337 ret = AVERROR_INVALIDDATA;
338 return AVERROR_INVALIDDATA;338 goto fail;
339 }339 }
340 s->ch_offset += MAX_CHANNELS;340 s->ch_offset += MAX_CHANNELS;
341 get_bits_align32(gb);341 get_bits_align32(gb);

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