OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9ecabd7
)
h264: check that an IDR NAL only contains I slices
author
Anton Khirnov
<anton@khirnov.net>
Thu, 28 Nov 2013 09:54:35 +0000
(10:54 +0100)
committer
Anton Khirnov
<anton@khirnov.net>
Sat, 18 Jan 2014 19:53:31 +0000
(20:53 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
libavcodec/h264.c
patch
|
blob
|
history
diff --git
a/libavcodec/h264.c
b/libavcodec/h264.c
index
6f329aa
..
4b10a68
100644
(file)
--- a/
libavcodec/h264.c
+++ b/
libavcodec/h264.c
@@
-3383,6
+3383,12
@@
static int decode_slice_header(H264Context *h, H264Context *h0)
h->slice_type = slice_type;
h->slice_type_nos = slice_type & 3;
+ if (h->nal_unit_type == NAL_IDR_SLICE &&
+ h->slice_type_nos != AV_PICTURE_TYPE_I) {
+ av_log(h->avctx, AV_LOG_ERROR, "A non-intra slice in an IDR NAL unit.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
// to make a few old functions happy, it's wrong though
h->pict_type = h->slice_type;