File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -521,6 +521,10 @@ status_t MPEG4Extractor::readMetaData() {
521
521
}
522
522
if (psshsize) {
523
523
char *buf = (char *)malloc (psshsize);
524
+ if (!buf) {
525
+ ALOGE (" b/28471206" );
526
+ return NO_MEMORY;
527
+ }
524
528
char *ptr = buf;
525
529
for (size_t i = 0 ; i < mPssh .size (); i++) {
526
530
memcpy (ptr, mPssh [i].uuid , 20 ); // uuid + length
@@ -1572,6 +1576,11 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
1572
1576
{
1573
1577
sp<ABuffer> buffer = new ABuffer (chunk_data_size);
1574
1578
1579
+ if (buffer->data () == NULL ) {
1580
+ ALOGE (" b/28471206" );
1581
+ return NO_MEMORY;
1582
+ }
1583
+
1575
1584
if (mDataSource ->readAt (
1576
1585
data_offset, buffer->data (), chunk_data_size) < chunk_data_size) {
1577
1586
return ERROR_IO;
@@ -1786,6 +1795,10 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
1786
1795
return ERROR_MALFORMED;
1787
1796
}
1788
1797
sp<ABuffer> buffer = new ABuffer (chunk_data_size + 1 );
1798
+ if (buffer->data () == NULL ) {
1799
+ ALOGE (" b/28471206" );
1800
+ return NO_MEMORY;
1801
+ }
1789
1802
if (mDataSource ->readAt (
1790
1803
data_offset, buffer->data (), chunk_data_size) != (ssize_t )chunk_data_size) {
1791
1804
return ERROR_IO;
You can’t perform that action at this time.
0 commit comments