mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
movenchint: Clear size and len if the realloc failed
Previously these were left in an inconsistent state. Pointed out by Michael Niedermayer. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
f2b00a5372
commit
b6c7bd53f4
@ -105,9 +105,11 @@ static void sample_queue_push(HintSampleQueue *queue, uint8_t *data, int size,
|
||||
return;
|
||||
if (!queue->samples || queue->len >= queue->size) {
|
||||
queue->size += 10;
|
||||
if (av_reallocp(&queue->samples, sizeof(*queue->samples) * queue->size) < 0)
|
||||
if (av_reallocp(&queue->samples, sizeof(*queue->samples) * queue->size) < 0) {
|
||||
queue->len = queue->size = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
queue->samples[queue->len].data = data;
|
||||
queue->samples[queue->len].size = size;
|
||||
queue->samples[queue->len].sample_number = sample;
|
||||
|
Loading…
Reference in New Issue
Block a user