Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: libavcodec/h264.c

Issue 9370003: Remove pthreads patch, roll in new patches, disable unchecked bit readers. (Closed) Base URL: ssh://gerrit.chromium.org:29418/chromium/third_party/ffmpeg.git@master
Patch Set: gyp fix. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: libavcodec/h264.c
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 7a16bdaedc3039b5441bf86fc3d671e25ad5965a..2fea444e94e5cb70b6b4fe92d103f9adf1a85317 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -25,8 +25,6 @@
* @author Michael Niedermayer <michaelni@gmx.at>
*/
-#define UNCHECKED_BITSTREAM_READER 1
-
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "internal.h"
@@ -1097,6 +1095,8 @@ int ff_h264_decode_extradata(H264Context *h, const uint8_t *buf, int size)
cnt = *(p+5) & 0x1f; // Number of sps
p += 6;
for (i = 0; i < cnt; i++) {
+ if(size - (p-buf) < 2)
+ return -1;
nalsize = AV_RB16(p) + 2;
if(nalsize > size - (p-buf))
return -1;
@@ -1106,9 +1106,13 @@ int ff_h264_decode_extradata(H264Context *h, const uint8_t *buf, int size)
}
p += nalsize;
}
+ if(size - (p-buf) <= 0)
+ return -1;
// Decode pps from avcC
cnt = *(p++); // Number of pps
for (i = 0; i < cnt; i++) {
+ if(size - (p-buf) < 2)
+ return -1;
nalsize = AV_RB16(p) + 2;
if(nalsize > size - (p-buf))
return -1;
« configure ('K') | « libavcodec/h263dec.c ('k') | libavcodec/h264_cabac.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698