diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-03-12 22:01:02 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-03-14 20:56:55 +0100 |
commit | d94256d36cc789788a68c6b35d31481c4b16fdd3 (patch) | |
tree | b77c23193123a322d7d229fb8a1388e028068b4c | |
parent | 7bb97a61dfb65a3825e17c2dc1e0e693b5607ec6 (diff) | |
download | ffmpeg-d94256d36cc789788a68c6b35d31481c4b16fdd3.tar.gz |
Revert "h264: clear trailing bits in partially parsed NAL units"
This reverts commit 729ebb2f185244b0ff06d48edbbbbb02ceb4ed4e.
There was an off-by-one error in the bit mask calculation clearing
actually the last valid bit and causing
http://bugzilla.libav.org/show_bug.cgi?id=227
The broken sample (Mr_MrsSmith-h264_aac.mp4) the commit was fixing
does not work after correcting the off-by-one error.
CC: libav-stable@libav.org
(cherry picked from commit 8a6037c3900875ccab8d553d2cc659bdef2c9d0e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/h264.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 449c634cfe..46e6c72832 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3763,7 +3763,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ int consumed; int dst_length; int bit_length; - uint8_t *ptr; + const uint8_t *ptr; int i, nalsize = 0; int err; @@ -3813,9 +3813,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ } if (h->is_avc && (nalsize != consumed) && nalsize){ - // set trailing bits in the last partial byte to zero - if (bit_length & 7) - ptr[bit_length >> 3] = ptr[bit_length >> 3] & (0xff << 8 - (bit_length & 7)); av_log(h->s.avctx, AV_LOG_DEBUG, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize); } |