Closed Bug 1184616 Opened 9 years ago Closed 6 years ago

Uninitialised value use in android::OMXCodec::read

Categories

(Core :: Audio/Video: Playback, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
firefox42 --- affected

People

(Reporter: jseward, Unassigned)

Details

(Whiteboard: [POVB])

Attachments

(1 file)

STR: Build Aries-KK (./config.sh aries) and run Valgrind as described at
https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Debugging_B2G_using_valgrind

I think this occurs when running the browser and trying to play a 
Youtube video, but tbh I am not entirely sure.
Attached file Valgrind complaint
Component: Widget: Gonk → Video/Audio
Anthony, can you help out?
Flags: needinfo?(ajones)
From a bit of digging around, it looks as if the problem is as follows:

frameworks/av/media/libstagefright/OMXCodec.cpp:4249 looks at
a BufferInfo::mOutputCropped field:

    if (info->mOutputCropChanged) {  <---- 4249
        initNativeWindowCrop();
        info->mOutputCropChanged = false;
    }

I believe the structure that |info| points at was created at
frameworks/av/media/libstagefright/OMXCodec.cpp:2050

        BufferInfo info;  <----- 2050
        info.mData = NULL;
        info.mSize = def.nBufferSize;
        info.mStatus = OWNED_BY_US;
        info.mMem = NULL;
        info.mMediaBuffer = new MediaBuffer(graphicBuffer);
        info.mMediaBuffer->setObserver(this);

This unfortunately fails to initialise mOutputCropChanged.
Blake - do you want this one?
Flags: needinfo?(bwu)
Yeah. I can check it.
Flags: needinfo?(bwu)
Flags: needinfo?(ajones)
Agree with comment 3, mOutputCropChanged is not initialized in allocateOutputBuffersFromNativeWindow(). 
It looks like it is a bug caused by CAF for the commit (9310a8d8ce6551046532f27989e1819b103e8d70) about "Smooth Streaming in OMXCodec". Android doesn't have mOutputCropChanged.
Ni Carol to get CAF's attention.
Flags: needinfo?(cyang)
Flags: needinfo?(cyang) → needinfo?(ggrisco)
Ok, I have a question out to our video experts to analyze this.  I hope to respond here tomorrow.
Yes, it's confirmed that this field needs to be initialized as stated above.  I'll create the patch and make sure it gets pushed to CAF.
Flags: needinfo?(ggrisco)
Whiteboard: [POVB]
(In reply to Greg Grisco from comment #9)
> Yes, it's confirmed that this field needs to be initialized as stated above.
> I'll create the patch and make sure it gets pushed to CAF.
Thanks!
Component: Audio/Video → Audio/Video: Playback
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: