Bug 194265 - vp8e_mr_alloc_mem() leaks LOWER_RES_FRAME_INFO if second memory allocation fails
Summary: vp8e_mr_alloc_mem() leaks LOWER_RES_FRAME_INFO if second memory allocation fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-02-04 18:16 PST by David Kilzer (:ddkilzer)
Modified: 2019-02-05 09:32 PST (History)
4 users (show)

See Also:


Attachments
Patch v1 (4.12 KB, patch)
2019-02-04 18:25 PST, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2019-02-04 18:16:27 PST
vp8e_mr_alloc_mem() leaks LOWER_RES_FRAME_INFO if second memory allocation fails via clang static analyzer:

Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/libvpx/vp8/vp8_cx_iface.c:589:5: warning: Value stored to 'res' is never read
    res = VPX_CODEC_MEM_ERROR;
    ^     ~~~~~~~~~~~~~~~~~~~
Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/libvpx/vp8/vp8_cx_iface.c:592:27: warning: Access to field 'mb_info' results in a dereference of a null pointer (loaded from variable 'shared_mem_loc')
  shared_mem_loc->mb_info =
  ~~~~~~~~~~~~~~          ^
Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/libvpx/vp8/vp8_cx_iface.c:595:11: warning: Potential leak of memory pointed to by 'shared_mem_loc'
    res = VPX_CODEC_MEM_ERROR;
          ^~~~~~~~~~~~~~~~~~~
3 warnings generated.
Comment 1 David Kilzer (:ddkilzer) 2019-02-04 18:25:25 PST
Created attachment 361148 [details]
Patch v1
Comment 2 Radar WebKit Bug Importer 2019-02-04 18:41:27 PST
<rdar://problem/47808154>
Comment 3 WebKit Commit Bot 2019-02-04 19:25:00 PST
Comment on attachment 361148 [details]
Patch v1

Clearing flags on attachment: 361148

Committed r240961: <https://trac.webkit.org/changeset/240961>
Comment 4 WebKit Commit Bot 2019-02-04 19:25:01 PST
All reviewed patches have been landed.  Closing bug.