diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-12 00:07:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-12 00:22:15 +0200 |
commit | e0909ff1584dc90499409707c5f91bf6ce78b09e (patch) | |
tree | 79eabf90704e57a1950b92a13ca91772224c88e7 /libavcodec/utils.c | |
parent | 0c6b9b9fe5edb7b4307e1705bac7f1087262a6fb (diff) | |
download | ffmpeg-e0909ff1584dc90499409707c5f91bf6ce78b09e.tar.gz |
lavc: Fix use of uninitialized field.
Fixes CID732297
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 8b65976806..166b3b43a2 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -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; } |