Commit 18507b48 authored by James Almer's avatar James Almer

avformat/avc: fix sps buffer offset when calling ff_avc_decode_sps()

Skip the avcC specific size bytes and the NAL header bits.
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 0d67af34
...@@ -197,7 +197,7 @@ int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len) ...@@ -197,7 +197,7 @@ int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len)
avio_write(pb, pps, pps_size); avio_write(pb, pps, pps_size);
if (sps[3] != 66 && sps[3] != 77 && sps[3] != 88) { if (sps[3] != 66 && sps[3] != 77 && sps[3] != 88) {
H264SequenceParameterSet *seq = ff_avc_decode_sps(sps, sps_size); H264SequenceParameterSet *seq = ff_avc_decode_sps(sps + 3, sps_size - 3);
if (!seq) if (!seq)
goto fail; goto fail;
avio_w8(pb, 0xfc | seq->chroma_format_idc); /* 6 bits reserved (111111) + chroma_format_idc */ avio_w8(pb, 0xfc | seq->chroma_format_idc); /* 6 bits reserved (111111) + chroma_format_idc */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment