diff options
author | Andreas Öman <andreas@lonelycoder.com> | 2008-01-09 08:38:28 +0000 |
---|---|---|
committer | Andreas Öman <andreas@lonelycoder.com> | 2008-01-09 08:38:28 +0000 |
commit | 48aecf5a7dd8e914d44cb4210a09172dbd8d5d86 (patch) | |
tree | d54ffbb02b7b4ed5f5dc5e4fd669a5bb14ac46b6 /libavcodec/h264_mp4toannexb_bsf.c | |
parent | 8b389f15cd6fb06bb43c277253837e13e3728f2b (diff) | |
download | ffmpeg-48aecf5a7dd8e914d44cb4210a09172dbd8d5d86.tar.gz |
Fix a bug causing the generated stream to be corrupt if the buffer
contains NAL units previous to the IDR where the SPS/PPS was inserted.
Ok:ed by Benoit on irc.
Originally committed as revision 11482 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_mp4toannexb_bsf.c')
-rw-r--r-- | libavcodec/h264_mp4toannexb_bsf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c index a4cbf87310..03eb956caf 100644 --- a/libavcodec/h264_mp4toannexb_bsf.c +++ b/libavcodec/h264_mp4toannexb_bsf.c @@ -41,8 +41,8 @@ static void alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size, if (!offset) AV_WB32(*poutbuf+sps_pps_size, 1); else { - (*poutbuf+offset)[0] = (*poutbuf+offset)[1] = 0; - (*poutbuf+offset)[2] = 1; + (*poutbuf+offset+sps_pps_size)[0] = (*poutbuf+offset+sps_pps_size)[1] = 0; + (*poutbuf+offset+sps_pps_size)[2] = 1; } } |