Commit fca7e34b authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

Fix leaks encountered while skipping packets.

Apparently zero byte, nullptr packets can still be attached to memory,
who knew!

BUG=852093,910896,910898,910928
TEST=local run shows no leaks.
R=tmathmeyer

Change-Id: Iff90057b02e37cb67b9d443ffeb92695e6e5c7f8
Reviewed-on: https://chromium-review.googlesource.com/c/1359060Reviewed-by: default avatarTed Meyer <tmathmeyer@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613282}
parent fbeab203
...@@ -228,9 +228,11 @@ static int ReadFrameAndDiscardEmpty(AVFormatContext* context, ...@@ -228,9 +228,11 @@ static int ReadFrameAndDiscardEmpty(AVFormatContext* context,
do { do {
result = av_read_frame(context, packet); result = av_read_frame(context, packet);
drop_packet = (!packet->data || !packet->size) && result >= 0; drop_packet = (!packet->data || !packet->size) && result >= 0;
DLOG_IF(WARNING, drop_packet) if (drop_packet) {
<< "Dropping empty packet, size: " << packet->size av_packet_unref(packet);
<< ", data: " << static_cast<void*>(packet->data); DLOG(WARNING) << "Dropping empty packet, size: " << packet->size
<< ", data: " << static_cast<void*>(packet->data);
}
} while (drop_packet); } while (drop_packet);
return result; return result;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment