mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-18 21:07:01 +00:00
qdm2: Conceal broken samples
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
parent
adadc3f244
commit
4ecdb5ed44
@ -525,8 +525,8 @@ static void build_sb_samples_from_noise(QDM2Context *q, int sb)
|
|||||||
* @param channels number of channels
|
* @param channels number of channels
|
||||||
* @param coding_method q->coding_method[0][0][0]
|
* @param coding_method q->coding_method[0][0][0]
|
||||||
*/
|
*/
|
||||||
static void fix_coding_method_array(int sb, int channels,
|
static int fix_coding_method_array(int sb, int channels,
|
||||||
sb_int8_array coding_method)
|
sb_int8_array coding_method)
|
||||||
{
|
{
|
||||||
int j, k;
|
int j, k;
|
||||||
int ch;
|
int ch;
|
||||||
@ -534,6 +534,8 @@ static void fix_coding_method_array(int sb, int channels,
|
|||||||
|
|
||||||
for (ch = 0; ch < channels; ch++) {
|
for (ch = 0; ch < channels; ch++) {
|
||||||
for (j = 0; j < 64; ) {
|
for (j = 0; j < 64; ) {
|
||||||
|
if (coding_method[ch][sb][j] < 8)
|
||||||
|
return -1;
|
||||||
if ((coding_method[ch][sb][j] - 8) > 22) {
|
if ((coding_method[ch][sb][j] - 8) > 22) {
|
||||||
run = 1;
|
run = 1;
|
||||||
case_val = 8;
|
case_val = 8;
|
||||||
@ -579,6 +581,7 @@ static void fix_coding_method_array(int sb, int channels,
|
|||||||
j += run;
|
j += run;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -840,7 +843,11 @@ static void synthfilt_build_sb_samples(QDM2Context *q, GetBitContext *gb,
|
|||||||
if (q->coding_method[1][sb][j] > q->coding_method[0][sb][j])
|
if (q->coding_method[1][sb][j] > q->coding_method[0][sb][j])
|
||||||
q->coding_method[0][sb][j] = q->coding_method[1][sb][j];
|
q->coding_method[0][sb][j] = q->coding_method[1][sb][j];
|
||||||
|
|
||||||
fix_coding_method_array(sb, q->nb_channels, q->coding_method);
|
if (fix_coding_method_array(sb, q->nb_channels,
|
||||||
|
q->coding_method)) {
|
||||||
|
build_sb_samples_from_noise(q, sb);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
channels = 1;
|
channels = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user