diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-09-30 20:58:01 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2012-09-30 21:00:52 +0200 |
commit | 13d878366f4ef15e64d2fc29d482ab283ac75282 (patch) | |
tree | cffba096b8c694f6ba3550225afbfa770add0b42 | |
parent | a8cb21fd62a1a148d5266324b85810be3c4aca4f (diff) | |
download | ffmpeg-13d878366f4ef15e64d2fc29d482ab283ac75282.tar.gz |
lavfi/ashowinfo: check plane value before deferencing.
-rw-r--r-- | libavfilter/af_ashowinfo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/af_ashowinfo.c b/libavfilter/af_ashowinfo.c index 0d4bbb23f6..25a5e2ca67 100644 --- a/libavfilter/af_ashowinfo.c +++ b/libavfilter/af_ashowinfo.c @@ -53,7 +53,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) if (!av_sample_fmt_is_planar(samplesref->format)) linesize *= av_get_channel_layout_nb_channels(samplesref->audio->channel_layout); - for (plane = 0; samplesref->data[plane] && plane < 8; plane++) { + for (plane = 0; plane < 8 && samplesref->data[plane]; plane++) { uint8_t *data = samplesref->data[plane]; plane_checksum[plane] = av_adler32_update(plane_checksum[plane], @@ -78,7 +78,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) checksum, plane_checksum[0]); - for (plane = 1; samplesref->data[plane] && plane < 8; plane++) + for (plane = 1; plane < 8 && samplesref->data[plane]; plane++) av_log(ctx, AV_LOG_INFO, " %08X", plane_checksum[plane]); av_log(ctx, AV_LOG_INFO, "]\n"); |