Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcd4bd56 authored by Praveen Chavan's avatar Praveen Chavan Committed by Linux Build Service Account
Browse files

Stagefright: avc_utils: handle invalid sample aspect ratio

Set sample aspect ratio width & height only if both sar_width
and sar_height are valid ( >1 ). sar-height being 0
can cause divide by zero exception in NuPlayer

Change-Id: Idfc4cae57651f3b5fd755057a880503f359aa004
CRs-Fixed: 735506
parent e92a4877
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -381,7 +381,7 @@ sp<MetaData> MakeAVCCodecSpecificData(const sp<ABuffer> &accessUnit) {
    meta->setInt32(kKeyWidth, width);
    meta->setInt32(kKeyHeight, height);

    if (sarWidth > 1 || sarHeight > 1) {
    if (sarWidth > 1 && sarHeight > 1) {
        // We treat 0:0 (unspecified) as 1:1.

        meta->setInt32(kKeySARWidth, sarWidth);