Browse Source

h264_sei: check SEI size

Signed-off-by: Anton Khirnov <anton@khirnov.net>
tags/n2.1
Michael Niedermayer Anton Khirnov 12 years ago
parent
commit
84df6d6a85
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/h264_sei.c

+ 6
- 0
libavcodec/h264_sei.c View File

@@ -190,6 +190,12 @@ int ff_h264_decode_sei(H264Context *h)
size += show_bits(&h->gb, 8); size += show_bits(&h->gb, 8);
while (get_bits(&h->gb, 8) == 255); while (get_bits(&h->gb, 8) == 255);


if (size > get_bits_left(&h->gb) / 8) {
av_log(h->avctx, AV_LOG_ERROR, "SEI type %d truncated at %d\n",
type, get_bits_left(&h->gb));
return AVERROR_INVALIDDATA;
}

switch (type) { switch (type) {
case SEI_TYPE_PIC_TIMING: // Picture timing SEI case SEI_TYPE_PIC_TIMING: // Picture timing SEI
ret = decode_picture_timing(h); ret = decode_picture_timing(h);


Loading…
Cancel
Save