diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-05-17 07:17:44 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-05-17 07:17:44 +0000 |
commit | 119841c321957a27ed036aa26c4afc5bc9ad0aa9 (patch) | |
tree | 39539b5ee6fea07664edd2680ebc003794c4a925 | |
parent | 42162bacfad5d5b6cd58dad8d2a1f810ded8ca88 (diff) | |
parent | c32764350c8f66fcb9e17cd1ba70869da68ea62a (diff) | |
download | libmix-oreo-release.tar.gz |
release-request-6c498b17-9310-412b-ad36-3dcf25ffef73-for-git_oc-release-4017086 snap-temp-L16500000064871237android-security-8.0.0_r54android-security-8.0.0_r53android-security-8.0.0_r52android-cts-8.0_r9android-cts-8.0_r8android-cts-8.0_r7android-cts-8.0_r6android-cts-8.0_r5android-cts-8.0_r4android-cts-8.0_r3android-cts-8.0_r26android-cts-8.0_r25android-cts-8.0_r24android-cts-8.0_r23android-cts-8.0_r22android-cts-8.0_r21android-cts-8.0_r20android-cts-8.0_r2android-cts-8.0_r19android-cts-8.0_r18android-cts-8.0_r17android-cts-8.0_r16android-cts-8.0_r15android-cts-8.0_r14android-cts-8.0_r13android-cts-8.0_r12android-cts-8.0_r11android-cts-8.0_r10android-cts-8.0_r1android-8.0.0_r9android-8.0.0_r7android-8.0.0_r51android-8.0.0_r50android-8.0.0_r49android-8.0.0_r48android-8.0.0_r47android-8.0.0_r46android-8.0.0_r45android-8.0.0_r44android-8.0.0_r43android-8.0.0_r42android-8.0.0_r41android-8.0.0_r40android-8.0.0_r4android-8.0.0_r39android-8.0.0_r38android-8.0.0_r37android-8.0.0_r36android-8.0.0_r35android-8.0.0_r32android-8.0.0_r31android-8.0.0_r30android-8.0.0_r3android-8.0.0_r29android-8.0.0_r28android-8.0.0_r2android-8.0.0_r17android-8.0.0_r16android-8.0.0_r15android-8.0.0_r13android-8.0.0_r12android-8.0.0_r11android-8.0.0_r10android-8.0.0_r1security-oc-releaseoreo-security-releaseoreo-releaseoreo-r6-releaseoreo-r5-releaseoreo-r4-releaseoreo-r3-releaseoreo-r2-releaseoreo-cts-release
Change-Id: Iaa1704a3ab1c1d968c431a11ecefdb3a32233008
-rw-r--r-- | videodecoder/VideoDecoderAVC.cpp | 13 | ||||
-rw-r--r-- | videodecoder/VideoDecoderMPEG2.cpp | 13 | ||||
-rw-r--r-- | videodecoder/VideoDecoderMPEG4.cpp | 13 | ||||
-rw-r--r-- | videodecoder/VideoDecoderVP8.cpp | 13 | ||||
-rw-r--r-- | videodecoder/VideoDecoderWMV.cpp | 13 |
5 files changed, 65 insertions, 0 deletions
diff --git a/videodecoder/VideoDecoderAVC.cpp b/videodecoder/VideoDecoderAVC.cpp index f0e047e..a9ddc8b 100644 --- a/videodecoder/VideoDecoderAVC.cpp +++ b/videodecoder/VideoDecoderAVC.cpp @@ -25,6 +25,9 @@ #define NW_CONSUMED 2 #define POC_DEFAULT 0x7FFFFFFF +#define MAX_PICTURE_WIDTH_AVC 4096 +#define MAX_PICTURE_HEIGHT_AVC 4096 + VideoDecoderAVC::VideoDecoderAVC(const char *mimeType) : VideoDecoderBase(mimeType, VBP_H264), mToggleDPB(0), @@ -65,6 +68,11 @@ Decode_Status VideoDecoderAVC::start(VideoConfigBuffer *buffer) { status = VideoDecoderBase::parseBuffer(buffer->data, buffer->size, true, (void**)&data); CHECK_STATUS("VideoDecoderBase::parseBuffer"); + if (data->codec_data->frame_width > MAX_PICTURE_WIDTH_AVC || + data->codec_data->frame_height > MAX_PICTURE_HEIGHT_AVC) { + return DECODE_INVALID_DATA; + } + status = startVA(data); return status; } @@ -102,6 +110,11 @@ Decode_Status VideoDecoderAVC::decode(VideoDecodeBuffer *buffer) { (void**)&data); CHECK_STATUS("VideoDecoderBase::parseBuffer"); + if (data->codec_data->frame_width > MAX_PICTURE_WIDTH_AVC || + data->codec_data->frame_height > MAX_PICTURE_HEIGHT_AVC) { + return DECODE_INVALID_DATA; + } + if (!mVAStarted) { if (data->has_sps && data->has_pps) { status = startVA(data); diff --git a/videodecoder/VideoDecoderMPEG2.cpp b/videodecoder/VideoDecoderMPEG2.cpp index 928ee9b..9d6a784 100644 --- a/videodecoder/VideoDecoderMPEG2.cpp +++ b/videodecoder/VideoDecoderMPEG2.cpp @@ -18,6 +18,9 @@ #include "VideoDecoderTrace.h" #include <string.h> +#define MAX_PICTURE_WIDTH_MPEG2 1920 +#define MAX_PICTURE_HEIGHT_MPEG2 1088 + VideoDecoderMPEG2::VideoDecoderMPEG2(const char *mimeType) : VideoDecoderBase(mimeType, VBP_MPEG2), mBufferIDs(NULL), @@ -48,6 +51,11 @@ Decode_Status VideoDecoderMPEG2::start(VideoConfigBuffer *buffer) { (void**)&data); CHECK_STATUS("VideoDecoderBase::parseBuffer"); + if (data->codec_data->frame_width > MAX_PICTURE_WIDTH_MPEG2 || + data->codec_data->frame_height > MAX_PICTURE_HEIGHT_MPEG2) { + return DECODE_INVALID_DATA; + } + status = startVA(data); return status; } @@ -85,6 +93,11 @@ Decode_Status VideoDecoderMPEG2::decode(VideoDecodeBuffer *buffer) { (void**)&data); CHECK_STATUS("VideoDecoderBase::parseBuffer"); + if (data->codec_data->frame_width > MAX_PICTURE_WIDTH_MPEG2 || + data->codec_data->frame_height > MAX_PICTURE_HEIGHT_MPEG2) { + return DECODE_INVALID_DATA; + } + if (!mVAStarted) { status = startVA(data); CHECK_STATUS("startVA"); diff --git a/videodecoder/VideoDecoderMPEG4.cpp b/videodecoder/VideoDecoderMPEG4.cpp index 6472446..51543ab 100644 --- a/videodecoder/VideoDecoderMPEG4.cpp +++ b/videodecoder/VideoDecoderMPEG4.cpp @@ -18,6 +18,9 @@ #include "VideoDecoderTrace.h" #include <string.h> +#define MAX_PICTURE_WIDTH_MPEG4 1920 +#define MAX_PICTURE_HEIGHT_MPEG4 1088 + VideoDecoderMPEG4::VideoDecoderMPEG4(const char *mimeType) : VideoDecoderBase(mimeType, VBP_MPEG4), mLastVOPTimeIncrement(0), @@ -46,6 +49,11 @@ Decode_Status VideoDecoderMPEG4::start(VideoConfigBuffer *buffer) { status = VideoDecoderBase::parseBuffer(buffer->data, buffer->size, true, (void**)&data); CHECK_STATUS("VideoDecoderBase::parseBuffer"); + if (data->codec_data.video_object_layer_width > MAX_PICTURE_WIDTH_MPEG4 || + data->codec_data.video_object_layer_height > MAX_PICTURE_HEIGHT_MPEG4) { + return DECODE_INVALID_DATA; + } + status = startVA(data); return status; } @@ -80,6 +88,11 @@ Decode_Status VideoDecoderMPEG4::decode(VideoDecodeBuffer *buffer) { (void**)&data); CHECK_STATUS("VideoDecoderBase::parseBuffer"); + if (data->codec_data.video_object_layer_width > MAX_PICTURE_WIDTH_MPEG4 || + data->codec_data.video_object_layer_height > MAX_PICTURE_HEIGHT_MPEG4) { + return DECODE_INVALID_DATA; + } + if (!mVAStarted) { status = startVA(data); CHECK_STATUS("startVA"); diff --git a/videodecoder/VideoDecoderVP8.cpp b/videodecoder/VideoDecoderVP8.cpp index ab561da..a3d700a 100644 --- a/videodecoder/VideoDecoderVP8.cpp +++ b/videodecoder/VideoDecoderVP8.cpp @@ -18,6 +18,9 @@ #include "VideoDecoderTrace.h" #include <string.h> +#define MAX_PICTURE_WIDTH_VP8 1920 +#define MAX_PICTURE_HEIGHT_VP8 1088 + VideoDecoderVP8::VideoDecoderVP8(const char *mimeType) : VideoDecoderBase(mimeType, VBP_VP8) { invalidateReferenceFrames(0); @@ -132,6 +135,11 @@ Decode_Status VideoDecoderVP8::start(VideoConfigBuffer *buffer) { status = VideoDecoderBase::parseBuffer(buffer->data, buffer->size, true, (void**)&data); CHECK_STATUS("VideoDecoderBase::parseBuffer"); + if (data->codec_data->frame_width > MAX_PICTURE_WIDTH_VP8 || + data->codec_data->frame_height > MAX_PICTURE_HEIGHT_VP8) { + return DECODE_INVALID_DATA; + } + status = startVA(data); return status; } @@ -165,6 +173,11 @@ Decode_Status VideoDecoderVP8::decode(VideoDecodeBuffer *buffer) { (void**)&data); CHECK_STATUS("VideoDecoderBase::parseBuffer"); + if (data->codec_data->frame_width > MAX_PICTURE_WIDTH_VP8 || + data->codec_data->frame_height > MAX_PICTURE_HEIGHT_VP8) { + return DECODE_INVALID_DATA; + } + mShowFrame = data->codec_data->show_frame; if (!mVAStarted) { diff --git a/videodecoder/VideoDecoderWMV.cpp b/videodecoder/VideoDecoderWMV.cpp index 88b09b3..bd55888 100644 --- a/videodecoder/VideoDecoderWMV.cpp +++ b/videodecoder/VideoDecoderWMV.cpp @@ -18,6 +18,9 @@ #include "VideoDecoderTrace.h" #include <string.h> +#define MAX_PICTURE_WIDTH_VC1 1920 +#define MAX_PICTURE_HEIGHT_VC1 1088 + VideoDecoderWMV::VideoDecoderWMV(const char *mimeType) : VideoDecoderBase(mimeType, VBP_VC1), mBufferIDs(NULL), @@ -49,6 +52,11 @@ Decode_Status VideoDecoderWMV::start(VideoConfigBuffer *buffer) { status = parseBuffer(buffer->data, buffer->size, &data); CHECK_STATUS("parseBuffer"); + if (data->se_data->CODED_WIDTH > MAX_PICTURE_WIDTH_VC1 || + data->se_data->CODED_HEIGHT > MAX_PICTURE_HEIGHT_VC1) { + return DECODE_INVALID_DATA; + } + status = startVA(data); return status; } @@ -89,6 +97,11 @@ Decode_Status VideoDecoderWMV::decode(VideoDecodeBuffer *buffer) { status = parseBuffer(buffer->data, buffer->size, &data); CHECK_STATUS("parseBuffer"); + if (data->se_data->CODED_WIDTH > MAX_PICTURE_WIDTH_VC1 || + data->se_data->CODED_HEIGHT > MAX_PICTURE_HEIGHT_VC1) { + return DECODE_INVALID_DATA; + } + if (!mVAStarted) { status = startVA(data); CHECK_STATUS("startVA"); |