static int cook_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
static int cook_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
COOKContext *q = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
COOKContext *q = avctx->priv_data;
- q->frame.nb_samples = q->samples_per_channel;
- if ((ret = avctx->get_buffer(avctx, &q->frame)) < 0) {
+ frame->nb_samples = q->samples_per_channel;
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
return AVERROR_PATCHWELCOME;
}
av_log(avctx, AV_LOG_DEBUG, "MONO\n");
return AVERROR_PATCHWELCOME;
}
av_log(avctx, AV_LOG_DEBUG, "MONO\n");
return AVERROR_PATCHWELCOME;
}
av_log(avctx, AV_LOG_DEBUG, "JOINT_STEREO\n");
return AVERROR_PATCHWELCOME;
}
av_log(avctx, AV_LOG_DEBUG, "JOINT_STEREO\n");
- av_log_ask_for_sample(avctx, "Unknown Cook version.\n");
+ avpriv_request_sample(avctx, "Cook version %d",
+ q->subpacket[s].cookversion);
/* Try to catch some obviously faulty streams, othervise it might be exploitable */
if (q->subpacket[s].total_subbands > 53) {
/* Try to catch some obviously faulty streams, othervise it might be exploitable */
if (q->subpacket[s].total_subbands > 53) {
/* Try to catch some obviously faulty streams, othervise it might be exploitable */
if (q->samples_per_channel != 256 && q->samples_per_channel != 512 &&
q->samples_per_channel != 1024) {
/* Try to catch some obviously faulty streams, othervise it might be exploitable */
if (q->samples_per_channel != 256 && q->samples_per_channel != 512 &&
q->samples_per_channel != 1024) {
- av_log_ask_for_sample(avctx,
- "unknown amount of samples_per_channel = %d\n",
+ avpriv_request_sample(avctx, "samples_per_channel = %d",