mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
mlpdec: Simplify substream length mismatch error.
Originally committed as revision 18238 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
d544dcdf38
commit
d7952be311
@ -1017,8 +1017,10 @@ static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size,
|
|||||||
if (read_block_data(m, &gb, substr) < 0)
|
if (read_block_data(m, &gb, substr) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
} while ((get_bits_count(&gb) < substream_data_len[substr] * 8)
|
if (get_bits_count(&gb) >= substream_data_len[substr] * 8)
|
||||||
&& get_bits1(&gb) == 0);
|
goto substream_length_mismatch;
|
||||||
|
|
||||||
|
} while (!get_bits1(&gb));
|
||||||
|
|
||||||
skip_bits(&gb, (-get_bits_count(&gb)) & 15);
|
skip_bits(&gb, (-get_bits_count(&gb)) & 15);
|
||||||
if (substream_data_len[substr] * 8 - get_bits_count(&gb) >= 32) {
|
if (substream_data_len[substr] * 8 - get_bits_count(&gb) >= 32) {
|
||||||
@ -1049,9 +1051,7 @@ static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size,
|
|||||||
av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n" , substr);
|
av_log(m->avctx, AV_LOG_ERROR, "Substream %d checksum failed.\n" , substr);
|
||||||
}
|
}
|
||||||
if (substream_data_len[substr] * 8 != get_bits_count(&gb)) {
|
if (substream_data_len[substr] * 8 != get_bits_count(&gb)) {
|
||||||
av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n",
|
goto substream_length_mismatch;
|
||||||
substr);
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
next_substr:
|
next_substr:
|
||||||
@ -1065,6 +1065,10 @@ next_substr:
|
|||||||
|
|
||||||
return length;
|
return length;
|
||||||
|
|
||||||
|
substream_length_mismatch:
|
||||||
|
av_log(m->avctx, AV_LOG_ERROR, "substream %d length mismatch\n", substr);
|
||||||
|
return -1;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
m->params_valid = 0;
|
m->params_valid = 0;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user