diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 17:02:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 17:02:23 +0100 |
commit | 727b202330712eb981eb008b1e7a936d71092f71 (patch) | |
tree | 4072ae70d540b801a44f6964a7a143827bd3c927 | |
parent | eba2c2321bc51b0faf5df379e5968ef2aa581cd8 (diff) | |
parent | 2ea00e35e4e0b58f7a306dd55d8f72a21c32c946 (diff) | |
download | ffmpeg-727b202330712eb981eb008b1e7a936d71092f71.tar.gz |
Merge commit '2ea00e35e4e0b58f7a306dd55d8f72a21c32c946'
* commit '2ea00e35e4e0b58f7a306dd55d8f72a21c32c946':
h264: do not abuse the context as a temporary storage in get_last_needed_nal()
Conflicts:
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 3b9f072596..1c71e3fb8a 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1377,6 +1377,7 @@ static int get_last_needed_nal(H264Context *h, const uint8_t *buf, int buf_size) int first_slice = 0; while(1) { + GetBitContext gb; int nalsize = 0; int dst_length, bit_length, consumed; const uint8_t *ptr; @@ -1418,8 +1419,8 @@ static int get_last_needed_nal(H264Context *h, const uint8_t *buf, int buf_size) case NAL_DPA: case NAL_IDR_SLICE: case NAL_SLICE: - init_get_bits(&h->gb, ptr, bit_length); - if (!get_ue_golomb(&h->gb) || + init_get_bits(&gb, ptr, bit_length); + if (!get_ue_golomb(&gb) || !first_slice || first_slice != h->nal_unit_type) nals_needed = nal_index; |