projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
214c5f2
)
fix some crashes on negative nalsize.
author
Loren Merritt
<lorenm@u.washington.edu>
Tue, 14 Feb 2006 05:40:53 +0000
(
05:40
+0000)
committer
Loren Merritt
<lorenm@u.washington.edu>
Tue, 14 Feb 2006 05:40:53 +0000
(
05:40
+0000)
Originally committed as revision 5022 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/h264.c
patch
|
blob
|
history
diff --git
a/libavcodec/h264.c
b/libavcodec/h264.c
index
4c2f0cb
..
a90f9fa
100644
(file)
--- a/
libavcodec/h264.c
+++ b/
libavcodec/h264.c
@@
-7507,6
+7507,15
@@
static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
nalsize = 0;
for(i = 0; i < h->nal_length_size; i++)
nalsize = (nalsize << 8) | buf[buf_index++];
+ if(nalsize <= 1){
+ if(nalsize == 1){
+ buf_index++;
+ continue;
+ }else{
+ av_log(h->s.avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize);
+ break;
+ }
+ }
} else {
// start code prefix search
for(; buf_index + 3 < buf_size; buf_index++){