Skip to content
Snippets Groups Projects
Commit 1a8c6917 authored by Jindřich Makovička's avatar Jindřich Makovička Committed by Anton Khirnov
Browse files

h264: avoid stuck buffer pointer in decode_nal_units


When decode_nal_units() previously encountered a NAL_END_SEQUENCE,
and there are some junk bytes left in the input buffer, but no start codes,
buf_index gets stuck 3 bytes before the end of the buffer.

This can trigger an infinite loop in the caller code, eg. in
try_decode_trame(), as avcodec_decode_video() then keeps returning zeroes,
with 3 bytes of the input packet still available.

With this change, the remaining bytes are skipped so the whole packet gets
consumed.

CC:libav-stable@libav.org

Signed-off-by: default avatarJindřich Makovička <makovick@gmail.com>
Signed-off-by: default avatarAnton Khirnov <anton@khirnov.net>
parent 0f583d20
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment