OSDN Git Service

h2645_parse: handle embedded Annex B NAL units in size prefixed NAL units
authorJanne Grunau <janne-libav@jannau.net>
Thu, 7 Jul 2016 18:33:01 +0000 (20:33 +0200)
committerJanne Grunau <janne-libav@jannau.net>
Wed, 13 Jul 2016 20:18:52 +0000 (22:18 +0200)
commit17c99b6158f2c6720af74e81ee727ee50d2e7e96
treeca6f19e3b775305e57b72c3d9ae1b6c47c07cd21
parenta8cbe5a0ccebf60a8a8b0aba5d5716dd54c1595c
h2645_parse: handle embedded Annex B NAL units in size prefixed NAL units

Fixes a regression in ca2f19b9cc3 with some mov/mp4 files. The files have
several NAL units in the supposed single NAL unit after the size field.
Annex B start code prefixes are used to separate them. The first NAL unit
is correctly parsed but the buffer does not point to the next size field.
Instead semi random data (it seems to be the rbsp_stop_one_bit and the
start code prefix) is then parsed as length and will exceed the
remaining length of the buffer.

Patch based on the code in h264's decode_nal_units() and a similar
patch by Hendrik Leppkes in FFmpeg (a9bb4cf87d1).

Bug-Id: ffmpeg/trac5529
Reported-By: Vittorio Giovara
libavcodec/h2645_parse.c