2018-01-05 20:49 GMT+01:00 Jacob Trimble <[email protected]>:
> + if (!frag_stream_info->encryption_index) {
> + frag_stream_info->encryption_index =
> av_mallocz(sizeof(MOVEncryptionIndex));
sizeof(variable), please.
[...]
> + sample_count = avio_rb32(pb);
> +
> + encryption_index->encrypted_samples =
> av_mallocz_array(sizeof(AVEncryptionInfo*), sample_count);
This should be avoided if possible, see below.
> + if (!encryption_index->encrypted_samples) {
> return AVERROR(ENOMEM);
> }
> + encryption_index->nb_encrypted_samples = sample_count;
>
> - return av_aes_ctr_init(sc->cenc.aes_ctr, c->decryption_key);
> + for (i = 0; i < sample_count; i++) {
Please check here for eof...
> + ret = mov_read_sample_encryption_info(c, pb, sc,
> &encryption_index->encrypted_samples[i], use_subsamples);
... and insert a realloc here to avoid the large allocation above, see 1112ba01.
Thank you, Carl Eugen
_______________________________________________
ffmpeg-devel mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel