Commit b6c7bd53 authored by Martin Storsjö's avatar Martin Storsjö

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: 's avatarMartin Storsjö <martin@martin.st>
parent f2b00a53
......@@ -105,8 +105,10 @@ 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment