Skip to content

Commit

Permalink
webm_read_frame: avoid NULL dereference
Browse files Browse the repository at this point in the history
block may be NULL with block_entry_eos or from return of GetBlock()

Change-Id: Ia0dd3ffa46305ee70efcdc55c05c2ad24efc993b
  • Loading branch information
jzern committed Apr 25, 2017
1 parent 92ec067 commit 0be513e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webmdec.cc
Expand Up @@ -165,10 +165,11 @@ int webm_read_frame(struct WebmInputContext *webm_ctx, uint8_t **buffer,
}
if (get_new_block) {
block = block_entry->GetBlock();
if (block == NULL) return -1;
webm_ctx->block_frame_index = 0;
}
} while (block->GetTrackNumber() != webm_ctx->video_track_index ||
block_entry_eos);
} while (block_entry_eos ||
block->GetTrackNumber() != webm_ctx->video_track_index);

webm_ctx->cluster = cluster;
webm_ctx->block_entry = block_entry;
Expand Down

0 comments on commit 0be513e

Please sign in to comment.