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
325325 if (s->ch_offset == 0) {
326326 frame->nb_samples = s->frame_len;
327327 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
328− return ret;
328+ goto fail;
329329 if (!new_pkt)
330330 frame->pts = AV_NOPTS_VALUE;
331331 }
@@ -334,8 +334,8 @@ again: · 2 unmodified lines
334334 avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT,
335335 FFMIN(MAX_CHANNELS, s->channels - s->ch_offset), s->ch_offset)) {
336336 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;
339339 }
340340 s->ch_offset += MAX_CHANNELS;
341341 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