lavc: Fix use of uninitialized field.

Fixes CID732297
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-12 00:07:21 +02:00
parent 0c6b9b9fe5
commit e0909ff158
1 changed files with 8 additions and 4 deletions

View File

@ -1753,10 +1753,14 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
/* many decoders assign whole AVFrames, thus overwriting extended_data;
* make sure it's set correctly; assume decoders that actually use
* extended_data are doing it correctly */
planar = av_sample_fmt_is_planar(frame->format);
channels = av_get_channel_layout_nb_channels(frame->channel_layout);
if (!(planar && channels > AV_NUM_DATA_POINTERS))
frame->extended_data = frame->data;
if (*got_frame_ptr) {
planar = av_sample_fmt_is_planar(frame->format);
channels = av_get_channel_layout_nb_channels(frame->channel_layout);
if (!(planar && channels > AV_NUM_DATA_POINTERS))
frame->extended_data = frame->data;
} else {
frame->extended_data = NULL;
}
return ret;
}