systematically call WebPDemuxReleaseIterator() on dec->prev_iter_

Change-Id: I4a767134dcc52a7ee7c3bc5deb91012eaf7b6512
(cherry picked from commit aaf2a6a698)
This commit is contained in:
Pascal Massimino 2016-09-22 05:47:27 +00:00 committed by James Zern
parent 76e190735b
commit 33ca93f909

View File

@ -402,6 +402,7 @@ int WebPAnimDecoderGetNext(WebPAnimDecoder* dec,
// Update info of the previous frame and dispose it for the next iteration. // Update info of the previous frame and dispose it for the next iteration.
dec->prev_frame_timestamp_ = timestamp; dec->prev_frame_timestamp_ = timestamp;
WebPDemuxReleaseIterator(&dec->prev_iter_);
dec->prev_iter_ = iter; dec->prev_iter_ = iter;
dec->prev_frame_was_keyframe_ = is_key_frame; dec->prev_frame_was_keyframe_ = is_key_frame;
CopyCanvas(dec->curr_frame_, dec->prev_frame_disposed_, width, height); CopyCanvas(dec->curr_frame_, dec->prev_frame_disposed_, width, height);
@ -430,6 +431,7 @@ int WebPAnimDecoderHasMoreFrames(const WebPAnimDecoder* dec) {
void WebPAnimDecoderReset(WebPAnimDecoder* dec) { void WebPAnimDecoderReset(WebPAnimDecoder* dec) {
if (dec != NULL) { if (dec != NULL) {
dec->prev_frame_timestamp_ = 0; dec->prev_frame_timestamp_ = 0;
WebPDemuxReleaseIterator(&dec->prev_iter_);
memset(&dec->prev_iter_, 0, sizeof(dec->prev_iter_)); memset(&dec->prev_iter_, 0, sizeof(dec->prev_iter_));
dec->prev_frame_was_keyframe_ = 0; dec->prev_frame_was_keyframe_ = 0;
dec->next_frame_ = 1; dec->next_frame_ = 1;
@ -443,6 +445,7 @@ const WebPDemuxer* WebPAnimDecoderGetDemuxer(const WebPAnimDecoder* dec) {
void WebPAnimDecoderDelete(WebPAnimDecoder* dec) { void WebPAnimDecoderDelete(WebPAnimDecoder* dec) {
if (dec != NULL) { if (dec != NULL) {
WebPDemuxReleaseIterator(&dec->prev_iter_);
WebPDemuxDelete(dec->demux_); WebPDemuxDelete(dec->demux_);
WebPSafeFree(dec->curr_frame_); WebPSafeFree(dec->curr_frame_);
WebPSafeFree(dec->prev_frame_disposed_); WebPSafeFree(dec->prev_frame_disposed_);