remove uninitialized variable warning

Restructure if statement to clarify the error condition. Trigger the
error before clobbering pc-> variables.

Change-Id: Id01cab798a341ce9899078fdcec265a0e942a0b7
This commit is contained in:
Johann 2011-10-24 16:56:55 -07:00
parent f182376dd6
commit 9409af2083

View File

@ -667,8 +667,12 @@ int vp8_decode_frame(VP8D_COMP *pbi)
if (data_end - data < 3)
{
if (pbi->ec_active)
if (!pbi->ec_active)
{
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
"Truncated packet");
}
/* Declare the missing frame as an inter frame since it will
be handled as an inter frame when we have estimated its
motion vectors. */
@ -678,12 +682,6 @@ int vp8_decode_frame(VP8D_COMP *pbi)
first_partition_length_in_bytes = 0;
}
else
{
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
"Truncated packet");
}
}
else
{
pc->frame_type = (FRAME_TYPE)(data[0] & 1);
pc->version = (data[0] >> 1) & 7;