summaryrefslogtreecommitdiff
path: root/libavformat/avc.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-11-29 23:13:36 -0300
committerJames Almer <jamrial@gmail.com>2019-11-29 23:17:43 -0300
commit18507b48825da45055f7ba1f933aa64cf90de253 (patch)
treebe6572c7778cb3e26c92270ddddf45352dbc05f3 /libavformat/avc.c
parent0d67af34c2b200684aa8264c517e46abf792f292 (diff)
downloadffmpeg-18507b48825da45055f7ba1f933aa64cf90de253.tar.gz
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: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/avc.c')
-rw-r--r--libavformat/avc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/avc.c b/libavformat/avc.c
index a3516a2fb7..2fb16872c4 100644
--- a/libavformat/avc.c
+++ b/libavformat/avc.c
@@ -197,7 +197,7 @@ int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len)
avio_write(pb, pps, pps_size);
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)
goto fail;
avio_w8(pb, 0xfc | seq->chroma_format_idc); /* 6 bits reserved (111111) + chroma_format_idc */