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

Commit 7aa2ae77 authored by Praveen Chavan's avatar Praveen Chavan Committed by Gerrit - the friendly Code Review server
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 0aeb9483
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -420,7 +420,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);