History

Merge remote-tracking branch 'qatar/master'

* qatar/master: (34 commits) mlp_parser: fix the channel mask value used for the top surround channel vorbisenc: check all allocations for failure roqaudioenc: return AVERROR codes instead of -1 roqaudioenc: set correct bit rate roqaudioenc: use AVCodecContext.frame_size correctly. roqaudioenc: remove unneeded sample_fmt check ra144enc: use int16_t* for input samples rather than void* ra144enc: set AVCodecContext.coded_frame ra144enc: remove unneeded sample_fmt check nellymoserenc: set AVCodecContext.coded_frame nellymoserenc: improve error checking in encode_init() nellymoserenc: return AVERROR codes instead of -1 libvorbis: improve error checking in oggvorbis_encode_init() mpegaudioenc: return AVERROR codes instead of -1 libfaac: improve error checking and handling in Faac_encode_init() avutil: add AVERROR_UNKNOWN check for coded_frame allocation failure in several audio encoders audio encoders: do not set coded_frame->key_frame. g722enc: check for trellis data allocation error libspeexenc: export encoder delay through AVCodecContext.delay ... Conflicts: doc/APIchanges libavcodec/avcodec.h libavcodec/fraps.c libavcodec/kgv1dec.c libavcodec/libfaac.c libavcodec/libgsm.c libavcodec/libvorbis.c libavcodec/mlp_parser.c libavcodec/roqaudioenc.c libavcodec/vorbisenc.c libavutil/avutil.h libavutil/error.c libavutil/error.h

Michael Niedermayer committed 14 years ago

Commit 305e4b32 parents 8e03912 0a9efe430 files · +552 −237Browse files

Unified · Split

30 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +13 −0
  3. libavcodec/cdxl.c +2 −2
  4. libavcodec/fraps.c +8 −3
  5. libavcodec/g722enc.c +20 −12
  6. libavcodec/kgv1dec.c +43 −27
  7. libavcodec/libfaac.c +37 −18
  8. libavcodec/libspeexenc.c +3 −4
  9. libavcodec/libvo-aacenc.c +2 −0
  10. libavcodec/libvo-amrwbenc.c +2 −0
  11. libavcodec/libvorbis.c +73 −58
  12. libavcodec/mpegaudioenc.c +5 −4
  13. libavcodec/nellymoserenc.c +31 −16
  14. libavcodec/ra144enc.c +21 −11
  15. libavcodec/roqaudioenc.c +69 −32
  16. libavcodec/utils.c +7 −5
  17. libavcodec/vorbisdec.c +12 −0
  18. libavcodec/vorbisenc.c +92 −36
  19. libavcodec/xwdenc.c +4 −2
  20. libavformat/matroskadec.c +8 −5
  21. libavutil/avutil.h +1 −1
  22. libavutil/error.c +1 −0
  23. libavutil/error.h +1 −0
  24. tests/Makefile +1 −0
  25. tests/fate/cdxl.mak +14 −0
  26. tests/ref/fate/cdxl-ham6 +17 −0
  27. tests/ref/fate/cdxl-ham8 +2 −0
  28. tests/ref/fate/cdxl-pal8 +12 −0
  29. tests/ref/fate/cdxl-pal8-small +47 −0
  30. tests/ref/lavf/xwd +1 −1
doc/APIchanges+3−0
@@ -35,6 +35,9 @@ API changes, most recent first: · 34 unmodified lines
3535 2012-01-24 - xxxxxxx - lavfi 2.60.100
3636 Add avfilter_graph_dump.
3737
38+2012-xx-xx - xxxxxxx - lavu 51.24.0 - error.h
39+ Add AVERROR_UNKNOWN
40+
3841 2012-xx-xx - xxxxxxx - lavc 54.x.x
3942 Add duration field to AVCodecParserContext
4043
libavcodec/avcodec.h+13−0
@@ -1372,6 +1372,19 @@ typedef struct AVCodecContext { · 1371 unmodified lines
13721372 * the decoder output. (we assume the decoder matches the spec)
13731373 * Decoding: Number of frames delay in addition to what a standard decoder
13741374 * as specified in the spec would produce.
1375+ *
1376+ * Video:
1377+ * Number of frames the decoded output will be delayed relative to the
1378+ * encoded input.
1379+ *
1380+ * Audio:
1381+ * Number of "priming" samples added to the beginning of the stream
1382+ * during encoding. The decoded output will be delayed by this many
1383+ * samples relative to the input to the encoder. Note that this field is
1384+ * purely informational and does not directly affect the pts output by
1385+ * the encoder, which should always be based on the actual presentation
1386+ * time, including any delay.
1387+ *
13751388 * - encoding: Set by libavcodec.
13761389 * - decoding: Set by libavcodec.
13771390 */
libavcodec/cdxl.c+2−2
@@ -122,7 +122,7 @@ static void cdxl_decode_ham6(CDXLVideoContext *c) · 121 unmodified lines
122122 g = index * 0x11 << 8;
123123 break;
124124 }
125− AV_WN32(out + x * 3, r | g | b);
125+ AV_WL24(out + x * 3, r | g | b);
126126 }
127127 out += c->frame.linesize[0];
128128 }
@@ -165,7 +165,7 @@ static void cdxl_decode_ham8(CDXLVideoContext *c) · 36 unmodified lines
165165 g = (index << 10) | (g & (3 << 8));
166166 break;
167167 }
168− AV_WN32(out + x * 3, r | g | b);
168+ AV_WL24(out + x * 3, r | g | b);
169169 }
170170 out += c->frame.linesize[0];
171171 }
libavcodec/fraps.c+8−3
@@ -142,7 +142,7 @@ static int decode_frame(AVCodecContext *avctx, · 141 unmodified lines
142142 int i, j, is_chroma;
143143 const int planes = 3;
144144 uint8_t *out;
145−
145+ enum PixelFormat pix_fmt;
146146
147147 header = AV_RL32(buf);
148148 version = header & 0xff;
@@ -157,8 +157,6 @@ static int decode_frame(AVCodecContext *avctx, · 8 unmodified lines
157157
158158 buf += header_size;
159159
160− avctx->pix_fmt = version & 1 ? PIX_FMT_BGR24 : PIX_FMT_YUVJ420P;
161−
162160 if (version < 2) {
163161 unsigned needed_size = avctx->width*avctx->height*3;
164162 if (version == 0) needed_size /= 2;
@@ -205,6 +203,13 @@ static int decode_frame(AVCodecContext *avctx, · 40 unmodified lines
205203 f->key_frame = 1;
206204 f->reference = 0;
207205 f->buffer_hints = FF_BUFFER_HINTS_VALID;
206+
207+ pix_fmt = version & 1 ? PIX_FMT_BGR24 : PIX_FMT_YUVJ420P;
208+ if (avctx->pix_fmt != pix_fmt && f->data[0]) {
209+ avctx->release_buffer(avctx, f);
210+ }
211+ avctx->pix_fmt = pix_fmt;
212+
208213 if (ff_thread_get_buffer(avctx, f)) {
209214 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
210215 return -1;
libavcodec/g722enc.c+20−12
@@ -41,9 +41,22 @@ · 40 unmodified lines
4141 #define MIN_TRELLIS 0
4242 #define MAX_TRELLIS 16
4343
44+static av_cold int g722_encode_close(AVCodecContext *avctx)
45+{
46+ G722Context *c = avctx->priv_data;
47+ int i;
48+ for (i = 0; i < 2; i++) {
49+ av_freep(&c->paths[i]);
50+ av_freep(&c->node_buf[i]);
51+ av_freep(&c->nodep_buf[i]);
52+ }
53+ return 0;
54+}
55+
4456 static av_cold int g722_encode_init(AVCodecContext * avctx)
4557 {
4658 G722Context *c = avctx->priv_data;
59+ int ret;
4760
4861 if (avctx->channels != 1) {
4962 av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n");
@@ -62,6 +75,10 @@ static av_cold int g722_encode_init(AVCodecContext * avctx) · 12 unmodified lines
6275 c->paths[i] = av_mallocz(max_paths * sizeof(**c->paths));
6376 c->node_buf[i] = av_mallocz(2 * frontier * sizeof(**c->node_buf));
6477 c->nodep_buf[i] = av_mallocz(2 * frontier * sizeof(**c->nodep_buf));
78+ if (!c->paths[i] || !c->node_buf[i] || !c->nodep_buf[i]) {
79+ ret = AVERROR(ENOMEM);
80+ goto error;
81+ }
6582 }
6683 }
6784
@@ -100,18 +117,9 @@ static av_cold int g722_encode_init(AVCodecContext * avctx) · 32 unmodified lines
100117 }
101118
102119 return 0;
103−}
104−
105−static av_cold int g722_encode_close(AVCodecContext *avctx)
106−{
107− G722Context *c = avctx->priv_data;
108− int i;
109− for (i = 0; i < 2; i++) {
110− av_freep(&c->paths[i]);
111− av_freep(&c->node_buf[i]);
112− av_freep(&c->nodep_buf[i]);
113− }
114− return 0;
120+error:
121+ g722_encode_close(avctx);
122+ return ret;
115123 }
116124
117125 static const int16_t low_quant[33] = {
libavcodec/kgv1dec.c+43−27
@@ -30,10 +30,17 @@ · 29 unmodified lines
3030
3131 typedef struct {
3232 AVCodecContext *avctx;
33− AVFrame pic;
34− uint16_t *prev, *cur;
33+ AVFrame prev, cur;
3534 } KgvContext;
3635
36+static void decode_flush(AVCodecContext *avctx)
37+{
38+ KgvContext * const c = avctx->priv_data;
39+
40+ if (c->prev.data[0])
41+ avctx->release_buffer(avctx, &c->prev);
42+}
43+
3744 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
3845 {
3946 const uint8_t *buf = avpkt->data;
@@ -42,7 +49,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 2 unmodified lines
4249 int offsets[8];
4350 uint16_t *out, *prev;
4451 int outcnt = 0, maxcnt;
45− int w, h, i;
52+ int w, h, i, res;
4653
4754 if (avpkt->size < 2)
4855 return -1;
@@ -54,20 +61,23 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 5 unmodified lines
5461 if (av_image_check_size(w, h, 0, avctx))
5562 return -1;
5663
57− if (w != avctx->width || h != avctx->height)
64+ if (w != avctx->width || h != avctx->height) {
65+ if (c->prev.data[0])
66+ avctx->release_buffer(avctx, &c->prev);
5867 avcodec_set_dimensions(avctx, w, h);
68+ }
5969
6070 maxcnt = w * h;
6171
62− out = av_realloc(c->cur, w * h * 2);
63− if (!out)
64− return -1;
65− c->cur = out;
66−
67− prev = av_realloc(c->prev, w * h * 2);
68− if (!prev)
69− return -1;
70− c->prev = prev;
72+ c->cur.reference = 3;
73+ if ((res = avctx->get_buffer(avctx, &c->cur)) < 0)
74+ return res;
75+ out = (uint16_t *) c->cur.data[0];
76+ if (c->prev.data[0]) {
77+ prev = (uint16_t *) c->prev.data[0];
78+ } else {
79+ prev = NULL;
80+ }
7181
7282 for (i = 0; i < 8; i++)
7383 offsets[i] = -1;
@@ -80,6 +90,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 6 unmodified lines
8090 out[outcnt++] = code; // rgb555 pixel coded directly
8191 } else {
8292 int count;
93+ int inp_off;
8394 uint16_t *inp;
8495
8596 if ((code & 0x6000) == 0x6000) {
@@ -101,7 +112,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 15 unmodified lines
101112 if (maxcnt - start < count)
102113 break;
103114
104− inp = prev + start;
115+ if (!prev) {
116+ av_log(avctx, AV_LOG_ERROR,
117+ "Frame reference does not exist\n");
118+ break;
119+ }
120+
121+ inp = prev;
122+ inp_off = start;
105123 } else {
106124 // copy from earlier in this frame
107125 int offset = (code & 0x1FFF) + 1;
@@ -119,27 +137,28 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 11 unmodified lines
119137 if (outcnt < offset)
120138 break;
121139
122− inp = out + outcnt - offset;
140+ inp = out;
141+ inp_off = outcnt - offset;
123142 }
124143
125144 if (maxcnt - outcnt < count)
126145 break;
127146
128− for (i = 0; i < count; i++)
147+ for (i = inp_off; i < count + inp_off; i++) {
129148 out[outcnt++] = inp[i];
149+ }
130150 }
131151 }
132152
133153 if (outcnt - maxcnt)
134154 av_log(avctx, AV_LOG_DEBUG, "frame finished with %d diff\n", outcnt - maxcnt);
135155
136− c->pic.data[0] = (uint8_t *)c->cur;
137− c->pic.linesize[0] = w * 2;
138−
139156 *data_size = sizeof(AVFrame);
140− *(AVFrame*)data = c->pic;
157+ *(AVFrame*)data = c->cur;
141158
142− FFSWAP(uint16_t *, c->cur, c->prev);
159+ if (c->prev.data[0])
160+ avctx->release_buffer(avctx, &c->prev);
161+ FFSWAP(AVFrame, c->cur, c->prev);
143162
144163 return avpkt->size;
145164 }
@@ -150,18 +169,14 @@ static av_cold int decode_init(AVCodecContext *avctx) · 4 unmodified lines
150169
151170 c->avctx = avctx;
152171 avctx->pix_fmt = PIX_FMT_RGB555;
153− avcodec_get_frame_defaults(&c->pic);
172+ avctx->flags |= CODEC_FLAG_EMU_EDGE;
154173
155174 return 0;
156175 }
157176
158177 static av_cold int decode_end(AVCodecContext *avctx)
159178 {
160− KgvContext * const c = avctx->priv_data;
161−
162− av_freep(&c->cur);
163− av_freep(&c->prev);
164−
179+ decode_flush(avctx);
165180 return 0;
166181 }
167182
@@ -173,5 +188,6 @@ AVCodec ff_kgv1_decoder = { · 5 unmodified lines
173188 .init = decode_init,
174189 .close = decode_end,
175190 .decode = decode_frame,
191+ .flush = decode_flush,
176192 .long_name = NULL_IF_CONFIG_SMALL("Kega Game Video"),
177193 };
libavcodec/libfaac.c+37−18
@@ -38,28 +38,47 @@ static const int channel_maps[][6] = { · 37 unmodified lines
3838 { 2, 0, 1, 4, 5, 3 }, //< C L R Ls Rs LFE
3939 };
4040
41+static av_cold int Faac_encode_close(AVCodecContext *avctx)
42+{
43+ FaacAudioContext *s = avctx->priv_data;
44+
45+ av_freep(&avctx->coded_frame);
46+ av_freep(&avctx->extradata);
47+
48+ if (s->faac_handle)
49+ faacEncClose(s->faac_handle);
50+ return 0;
51+}
52+
4153 static av_cold int Faac_encode_init(AVCodecContext *avctx)
4254 {
4355 FaacAudioContext *s = avctx->priv_data;
4456 faacEncConfigurationPtr faac_cfg;
4557 unsigned long samples_input, max_bytes_output;
58+ int ret;
4659
4760 /* number of channels */
4861 if (avctx->channels < 1 || avctx->channels > 6) {
4962 av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed\n", avctx->channels);
50− return -1;
63+ ret = AVERROR(EINVAL);
64+ goto error;
5165 }
5266
5367 s->faac_handle = faacEncOpen(avctx->sample_rate,
5468 avctx->channels,
5569 &samples_input, &max_bytes_output);
70+ if (!s->faac_handle) {
71+ av_log(avctx, AV_LOG_ERROR, "error in faacEncOpen()\n");
72+ ret = AVERROR_UNKNOWN;
73+ goto error;
74+ }
5675
5776 /* check faac version */
5877 faac_cfg = faacEncGetCurrentConfiguration(s->faac_handle);
5978 if (faac_cfg->version != FAAC_CFG_VERSION) {
6079 av_log(avctx, AV_LOG_ERROR, "wrong libfaac version (compiled for: %d, using %d)\n", FAAC_CFG_VERSION, faac_cfg->version);
61− faacEncClose(s->faac_handle);
62− return -1;
80+ ret = AVERROR(EINVAL);
81+ goto error;
6382 }
6483
6584 /* put the options in the configuration struct */
@@ -79,8 +98,8 @@ static av_cold int Faac_encode_init(AVCodecContext *avctx) · 13 unmodified lines
7998 break;
8099 default:
81100 av_log(avctx, AV_LOG_ERROR, "invalid AAC profile\n");
82− faacEncClose(s->faac_handle);
83− return -1;
101+ ret = AVERROR(EINVAL);
102+ goto error;
84103 }
85104 faac_cfg->mpegVersion = MPEG4;
86105 faac_cfg->useTns = 0;
@@ -100,7 +119,10 @@ static av_cold int Faac_encode_init(AVCodecContext *avctx) · 13 unmodified lines
100119 avctx->frame_size = samples_input / avctx->channels;
101120
102121 avctx->coded_frame= avcodec_alloc_frame();
103− avctx->coded_frame->key_frame= 1;
122+ if (!avctx->coded_frame) {
123+ ret = AVERROR(ENOMEM);
124+ goto error;
125+ }
104126
105127 /* Set decoder specific info */
106128 avctx->extradata_size = 0;
@@ -112,6 +134,10 @@ static av_cold int Faac_encode_init(AVCodecContext *avctx) · 5 unmodified lines
112134 if (!faacEncGetDecoderSpecificInfo(s->faac_handle, &buffer,
113135 &decoder_specific_info_size)) {
114136 avctx->extradata = av_malloc(decoder_specific_info_size + FF_INPUT_BUFFER_PADDING_SIZE);
137+ if (!avctx->extradata) {
138+ ret = AVERROR(ENOMEM);
139+ goto error;
140+ }
115141 avctx->extradata_size = decoder_specific_info_size;
116142 memcpy(avctx->extradata, buffer, avctx->extradata_size);
117143 faac_cfg->outputFormat = 0;
@@ -123,10 +149,14 @@ static av_cold int Faac_encode_init(AVCodecContext *avctx) · 5 unmodified lines
123149
124150 if (!faacEncSetConfiguration(s->faac_handle, faac_cfg)) {
125151 av_log(avctx, AV_LOG_ERROR, "libfaac doesn't support this output format!\n");
126− return -1;
152+ ret = AVERROR(EINVAL);
153+ goto error;
127154 }
128155
129156 return 0;
157+error:
158+ Faac_encode_close(avctx);
159+ return ret;
130160 }
131161
132162 static int Faac_encode_frame(AVCodecContext *avctx,
@@ -145,17 +175,6 @@ static int Faac_encode_frame(AVCodecContext *avctx, · 12 unmodified lines
145175 return bytes_written;
146176 }
147177
148−static av_cold int Faac_encode_close(AVCodecContext *avctx)
149−{
150− FaacAudioContext *s = avctx->priv_data;
151−
152− av_freep(&avctx->coded_frame);
153− av_freep(&avctx->extradata);
154−
155− faacEncClose(s->faac_handle);
156− return 0;
157−}
158−
159178 static const AVProfile profiles[] = {
160179 { FF_PROFILE_AAC_MAIN, "Main" },
161180 { FF_PROFILE_AAC_LOW, "LC" },
libavcodec/libspeexenc.c+3−4
@@ -81,7 +81,6 @@ typedef struct { · 80 unmodified lines
8181 int cbr_quality; ///< CBR quality 0 to 10
8282 int abr; ///< flag to enable ABR
8383 int pkt_frame_count; ///< frame count for the current packet
84− int lookahead; ///< encoder delay
8584 int64_t next_pts; ///< next pts, in sample_rate time base
8685 int pkt_sample_count; ///< sample count in the current packet
8786 } LibSpeexEncContext;
@@ -200,8 +199,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 112 unmodified lines
200199 s->header.frames_per_packet = s->frames_per_packet;
201200
202201 /* set encoding delay */
203− speex_encoder_ctl(s->enc_state, SPEEX_GET_LOOKAHEAD, &s->lookahead);
204− s->next_pts = -s->lookahead;
202+ speex_encoder_ctl(s->enc_state, SPEEX_GET_LOOKAHEAD, &avctx->delay);
205203
206204 /* create header packet bytes from header struct */
207205 /* note: libspeex allocates the memory for header_data, which is freed
@@ -257,7 +255,8 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, · 49 unmodified lines
257255 /* write output if all frames for the packet have been encoded */
258256 if (s->pkt_frame_count == s->frames_per_packet) {
259257 s->pkt_frame_count = 0;
260− avctx->coded_frame->pts = ff_samples_to_time_base(avctx, s->next_pts);
258+ avctx->coded_frame->pts = ff_samples_to_time_base(avctx, s->next_pts -
259+ avctx->delay);
261260 s->next_pts += s->pkt_sample_count;
262261 s->pkt_sample_count = 0;
263262 if (buf_size > speex_bits_nbytes(&s->bits)) {
libavcodec/libvo-aacenc.c+2−0
@@ -39,6 +39,8 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 38 unmodified lines
3939 int index;
4040
4141 avctx->coded_frame = avcodec_alloc_frame();
42+ if (!avctx->coded_frame)
43+ return AVERROR(ENOMEM);
4244 avctx->frame_size = 1024;
4345
4446 voGetAACEncAPI(&s->codec_api);
libavcodec/libvo-amrwbenc.c+2−0
@@ -87,6 +87,8 @@ static av_cold int amr_wb_encode_init(AVCodecContext *avctx) · 86 unmodified lines
8787
8888 avctx->frame_size = 320;
8989 avctx->coded_frame = avcodec_alloc_frame();
90+ if (!avctx->coded_frame)
91+ return AVERROR(ENOMEM);
9092
9193 s->state = E_IF_init();
9294
libavcodec/libvorbis.c+73−58
@@ -61,13 +61,13 @@ static const AVOption options[] = { · 60 unmodified lines
6161 };
6262 static const AVClass class = { "libvorbis", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
6363
64−static const char * error(int oggerr, int *averr)
64+static int vorbis_error_to_averror(int ov_err)
6565 {
66− switch (oggerr) {
67− case OV_EFAULT: *averr = AVERROR(EFAULT); return "internal error";
68− case OV_EIMPL: *averr = AVERROR(EINVAL); return "not supported";
69− case OV_EINVAL: *averr = AVERROR(EINVAL); return "invalid request";
70− default: *averr = AVERROR(EINVAL); return "unknown error";
66+ switch (ov_err) {
67+ case OV_EFAULT: return AVERROR_BUG;
68+ case OV_EINVAL: return AVERROR(EINVAL);
69+ case OV_EIMPL: return AVERROR(EINVAL);
70+ default: return AVERROR_UNKNOWN;
7171 }
7272 }
7373
@@ -75,49 +75,41 @@ static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avcco · 1 unmodified line
7575 {
7676 OggVorbisContext *context = avccontext->priv_data;
7777 double cfreq;
78− int r;
78+ int ret;
7979
8080 if (avccontext->flags & CODEC_FLAG_QSCALE) {
8181 /* variable bitrate */
82− float quality = avccontext->global_quality / (float)FF_QP2LAMBDA;
83− r = vorbis_encode_setup_vbr(vi, avccontext->channels,
84− avccontext->sample_rate,
85− quality / 10.0);
86− if (r) {
87− av_log(avccontext, AV_LOG_ERROR,
88− "Unable to set quality to %g: %s\n", quality, error(r, &r));
89− return r;
90− }
82+ float q = avccontext->global_quality / (float)FF_QP2LAMBDA;
83+ if ((ret = vorbis_encode_setup_vbr(vi, avccontext->channels,
84+ avccontext->sample_rate,
85+ q / 10.0)))
86+ goto error;
9187 } else {
9288 int minrate = avccontext->rc_min_rate > 0 ? avccontext->rc_min_rate : -1;
9389 int maxrate = avccontext->rc_min_rate > 0 ? avccontext->rc_max_rate : -1;
9490
9591 /* constant bitrate */
96− r = vorbis_encode_setup_managed(vi, avccontext->channels,
97− avccontext->sample_rate, minrate,
98− avccontext->bit_rate, maxrate);
99− if (r) {
100− av_log(avccontext, AV_LOG_ERROR,
101− "Unable to set CBR to %d: %s\n", avccontext->bit_rate,
102− error(r, &r));
103− return r;
104− }
92+ if ((ret = vorbis_encode_setup_managed(vi, avccontext->channels,
93+ avccontext->sample_rate, minrate,
94+ avccontext->bit_rate, maxrate)))
95+ goto error;
10596
10697 /* variable bitrate by estimate, disable slow rate management */
10798 if (minrate == -1 && maxrate == -1)
108− if (vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE2_SET, NULL))
109− return AVERROR(EINVAL); /* should not happen */
99+ if ((ret = vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE2_SET, NULL)))
100+ goto error; /* should not happen */
110101 }
111102
112103 /* cutoff frequency */
113104 if (avccontext->cutoff > 0) {
114105 cfreq = avccontext->cutoff / 1000.0;
115− if (vorbis_encode_ctl(vi, OV_ECTL_LOWPASS_SET, &cfreq))
116− return AVERROR(EINVAL); /* should not happen */
106+ if ((ret = vorbis_encode_ctl(vi, OV_ECTL_LOWPASS_SET, &cfreq)))
107+ goto error; /* should not happen */
117108 }
118109
119110 if (context->iblock) {
120− vorbis_encode_ctl(vi, OV_ECTL_IBLOCK_SET, &context->iblock);
111+ if ((ret = vorbis_encode_ctl(vi, OV_ECTL_IBLOCK_SET, &context->iblock)))
112+ goto error;
121113 }
122114
123115 if (avccontext->channels == 3 &&
@@ -149,7 +141,12 @@ static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avcco · 25 unmodified lines
149141 }
150142 }
151143
152− return vorbis_encode_setup_init(vi);
144+ if ((ret = vorbis_encode_setup_init(vi)))
145+ goto error;
146+
147+ return 0;
148+error:
149+ return vorbis_error_to_averror(ret);
153150 }
154151
155152 /* How many bytes are needed for a buffer of length 'l' */
@@ -158,34 +155,63 @@ static int xiph_len(int l) · 2 unmodified lines
158155 return 1 + l / 255 + l;
159156 }
160157
158+static av_cold int oggvorbis_encode_close(AVCodecContext *avccontext)
159+{
160+ OggVorbisContext *context = avccontext->priv_data;
161+/* ogg_packet op ; */
162+
163+ vorbis_analysis_wrote(&context->vd, 0); /* notify vorbisenc this is EOF */
164+
165+ vorbis_block_clear(&context->vb);
166+ vorbis_dsp_clear(&context->vd);
167+ vorbis_info_clear(&context->vi);
168+
169+ av_freep(&avccontext->coded_frame);
170+ av_freep(&avccontext->extradata);
171+
172+ return 0;
173+}
174+
161175 static av_cold int oggvorbis_encode_init(AVCodecContext *avccontext)
162176 {
163177 OggVorbisContext *context = avccontext->priv_data;
164178 ogg_packet header, header_comm, header_code;
165179 uint8_t *p;
166180 unsigned int offset;
167− int r;
181+ int ret;
168182
169183 vorbis_info_init(&context->vi);
170− r = oggvorbis_init_encoder(&context->vi, avccontext);
171− if (r < 0) {
172− av_log(avccontext, AV_LOG_ERROR, "oggvorbis_encode_init failed\n");
173− return r;
184+ if ((ret = oggvorbis_init_encoder(&context->vi, avccontext))) {
185+ av_log(avccontext, AV_LOG_ERROR, "oggvorbis_encode_init: init_encoder failed\n");
186+ goto error;
187+ }
188+ if ((ret = vorbis_analysis_init(&context->vd, &context->vi))) {
189+ ret = vorbis_error_to_averror(ret);
190+ goto error;
191+ }
192+ if ((ret = vorbis_block_init(&context->vd, &context->vb))) {
193+ ret = vorbis_error_to_averror(ret);
194+ goto error;
174195 }
175− vorbis_analysis_init(&context->vd, &context->vi);
176− vorbis_block_init(&context->vd, &context->vb);
177196
178197 vorbis_comment_init(&context->vc);
179198 vorbis_comment_add_tag(&context->vc, "encoder", LIBAVCODEC_IDENT);
180199
181− vorbis_analysis_headerout(&context->vd, &context->vc, &header,
182− &header_comm, &header_code);
200+ if ((ret = vorbis_analysis_headerout(&context->vd, &context->vc, &header,
201+ &header_comm, &header_code))) {
202+ ret = vorbis_error_to_averror(ret);
203+ goto error;
204+ }
183205
184206 avccontext->extradata_size =
185207 1 + xiph_len(header.bytes) + xiph_len(header_comm.bytes) +
186208 header_code.bytes;
187209 p = avccontext->extradata =
188210 av_malloc(avccontext->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
211+ if (!p) {
212+ ret = AVERROR(ENOMEM);
213+ goto error;
214+ }
189215 p[0] = 2;
190216 offset = 1;
191217 offset += av_xiphlacing(&p[offset], header.bytes);
@@ -208,9 +234,15 @@ static av_cold int oggvorbis_encode_init(AVCodecContext *avccontext) · 16 unmodified lines
208234 avccontext->frame_size = OGGVORBIS_FRAME_SIZE;
209235
210236 avccontext->coded_frame = avcodec_alloc_frame();
211− avccontext->coded_frame->key_frame = 1;
237+ if (!avccontext->coded_frame) {
238+ ret = AVERROR(ENOMEM);
239+ goto error;
240+ }
212241
213242 return 0;
243+error:
244+ oggvorbis_encode_close(avccontext);
245+ return ret;
214246 }
215247
216248 static int oggvorbis_encode_frame(AVCodecContext *avccontext,
@@ -286,23 +318,6 @@ static int oggvorbis_encode_frame(AVCodecContext *avccontext, · 69 unmodified lines
286318 return l;
287319 }
288320
289−static av_cold int oggvorbis_encode_close(AVCodecContext *avccontext)
290−{
291− OggVorbisContext *context = avccontext->priv_data;
292−/* ogg_packet op ; */
293−
294− vorbis_analysis_wrote(&context->vd, 0); /* notify vorbisenc this is EOF */
295−
296− vorbis_block_clear(&context->vb);
297− vorbis_dsp_clear(&context->vd);
298− vorbis_info_clear(&context->vi);
299−
300− av_freep(&avccontext->coded_frame);
301− av_freep(&avccontext->extradata);
302−
303− return 0;
304−}
305−
306321 AVCodec ff_libvorbis_encoder = {
307322 .name = "libvorbis",
308323 .type = AVMEDIA_TYPE_AUDIO,
libavcodec/mpegaudioenc.c+5−4
@@ -75,7 +75,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) · 74 unmodified lines
7575
7676 if (channels <= 0 || channels > 2){
7777 av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed in mp2\n", channels);
78− return -1;
78+ return AVERROR(EINVAL);
7979 }
8080 bitrate = bitrate / 1000;
8181 s->nb_channels = channels;
@@ -93,7 +93,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) · 11 unmodified lines
9393 }
9494 if (i == 3){
9595 av_log(avctx, AV_LOG_ERROR, "Sampling rate %d is not allowed in mp2\n", freq);
96− return -1;
96+ return AVERROR(EINVAL);
9797 }
9898 s->freq_index = i;
9999
@@ -104,7 +104,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) · 4 unmodified lines
104104 }
105105 if (i == 15){
106106 av_log(avctx, AV_LOG_ERROR, "bitrate %d is not allowed in mp2\n", bitrate);
107− return -1;
107+ return AVERROR(EINVAL);
108108 }
109109 s->bitrate_index = i;
110110
@@ -181,7 +181,8 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) · 70 unmodified lines
181181 }
182182
183183 avctx->coded_frame= avcodec_alloc_frame();
184− avctx->coded_frame->key_frame= 1;
184+ if (!avctx->coded_frame)
185+ return AVERROR(ENOMEM);
185186
186187 return 0;
187188 }
libavcodec/nellymoserenc.c+31−16
@@ -127,14 +127,29 @@ static void apply_mdct(NellyMoserEncodeContext *s) · 126 unmodified lines
127127 s->mdct_ctx.mdct_calc(&s->mdct_ctx, s->mdct_out + NELLY_BUF_LEN, s->buf[s->bufsel] + NELLY_BUF_LEN);
128128 }
129129
130+static av_cold int encode_end(AVCodecContext *avctx)
131+{
132+ NellyMoserEncodeContext *s = avctx->priv_data;
133+
134+ ff_mdct_end(&s->mdct_ctx);
135+
136+ if (s->avctx->trellis) {
137+ av_free(s->opt);
138+ av_free(s->path);
139+ }
140+ av_freep(&avctx->coded_frame);
141+
142+ return 0;
143+}
144+
130145 static av_cold int encode_init(AVCodecContext *avctx)
131146 {
132147 NellyMoserEncodeContext *s = avctx->priv_data;
133− int i;
148+ int i, ret;
134149
135150 if (avctx->channels != 1) {
136151 av_log(avctx, AV_LOG_ERROR, "Nellymoser supports only 1 channel\n");
137− return -1;
152+ return AVERROR(EINVAL);
138153 }
139154
140155 if (avctx->sample_rate != 8000 && avctx->sample_rate != 16000 &&
@@ -142,12 +157,13 @@ static av_cold int encode_init(AVCodecContext *avctx) · 1 unmodified line
142157 avctx->sample_rate != 22050 && avctx->sample_rate != 44100 &&
143158 avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL) {
144159 av_log(avctx, AV_LOG_ERROR, "Nellymoser works only with 8000, 16000, 11025, 22050 and 44100 sample rate\n");
145− return -1;
160+ return AVERROR(EINVAL);
146161 }
147162
148163 avctx->frame_size = NELLY_SAMPLES;
149164 s->avctx = avctx;
150− ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0);
165+ if ((ret = ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0)) < 0)
166+ goto error;
151167 ff_dsputil_init(&s->dsp, avctx);
152168
153169 /* Generate overlap window */
@@ -158,23 +174,22 @@ static av_cold int encode_init(AVCodecContext *avctx) · 4 unmodified lines
158174 if (s->avctx->trellis) {
159175 s->opt = av_malloc(NELLY_BANDS * OPT_SIZE * sizeof(float ));
160176 s->path = av_malloc(NELLY_BANDS * OPT_SIZE * sizeof(uint8_t));
177+ if (!s->opt || !s->path) {
178+ ret = AVERROR(ENOMEM);
179+ goto error;
180+ }
161181 }
162182
163− return 0;
164−}
165−
166−static av_cold int encode_end(AVCodecContext *avctx)
167−{
168− NellyMoserEncodeContext *s = avctx->priv_data;
169−
170− ff_mdct_end(&s->mdct_ctx);
171−
172− if (s->avctx->trellis) {
173− av_free(s->opt);
174− av_free(s->path);
183+ avctx->coded_frame = avcodec_alloc_frame();
184+ if (!avctx->coded_frame) {
185+ ret = AVERROR(ENOMEM);
186+ goto error;
175187 }
176188
177189 return 0;
190+error:
191+ encode_end(avctx);
192+ return ret;
178193 }
179194
180195 #define find_best(val, table, LUT, LUT_add, LUT_size) \
libavcodec/ra144enc.c+21−11
@@ -33,15 +33,20 @@ · 32 unmodified lines
3333 #include "ra144.h"
3434
3535
36+static av_cold int ra144_encode_close(AVCodecContext *avctx)
37+{
38+ RA144Context *ractx = avctx->priv_data;
39+ ff_lpc_end(&ractx->lpc_ctx);
40+ av_freep(&avctx->coded_frame);
41+ return 0;
42+}
43+
44+
3645 static av_cold int ra144_encode_init(AVCodecContext * avctx)
3746 {
3847 RA144Context *ractx;
3948 int ret;
4049
41− if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
42− av_log(avctx, AV_LOG_ERROR, "invalid sample format\n");
43− return -1;
44− }
4550 if (avctx->channels != 1) {
4651 av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n",
4752 avctx->channels);
@@ -55,15 +60,19 @@ static av_cold int ra144_encode_init(AVCodecContext * avctx) · 7 unmodified lines
5560 ractx->avctx = avctx;
5661 ret = ff_lpc_init(&ractx->lpc_ctx, avctx->frame_size, LPC_ORDER,
5762 FF_LPC_TYPE_LEVINSON);
58− return ret;
59−}
63+ if (ret < 0)
64+ goto error;
6065
66+ avctx->coded_frame = avcodec_alloc_frame();
67+ if (!avctx->coded_frame) {
68+ ret = AVERROR(ENOMEM);
69+ goto error;
70+ }
6171
62−static av_cold int ra144_encode_close(AVCodecContext *avctx)
63−{
64− RA144Context *ractx = avctx->priv_data;
65− ff_lpc_end(&ractx->lpc_ctx);
6672 return 0;
73+error:
74+ ra144_encode_close(avctx);
75+ return ret;
6776 }
6877
6978
@@ -432,6 +441,7 @@ static int ra144_encode_frame(AVCodecContext *avctx, uint8_t *frame, · 362 unmodified lines
432441 int16_t block_coefs[NBLOCKS][LPC_ORDER];
433442 int lpc_refl[LPC_ORDER]; /**< reflection coefficients of the frame */
434443 unsigned int refl_rms[NBLOCKS]; /**< RMS of the reflection coefficients */
444+ const int16_t *samples = data;
435445 int energy = 0;
436446 int i, idx;
437447
@@ -506,7 +516,7 @@ static int ra144_encode_frame(AVCodecContext *avctx, uint8_t *frame, · 68 unmodified lines
506516 ractx->lpc_refl_rms[1] = ractx->lpc_refl_rms[0];
507517 FFSWAP(unsigned int *, ractx->lpc_coef[0], ractx->lpc_coef[1]);
508518 for (i = 0; i < NBLOCKS * BLOCKSIZE; i++)
509− ractx->curr_block[i] = *((int16_t *)data + i) >> 2;
519+ ractx->curr_block[i] = samples[i] >> 2;
510520 return FRAMESIZE;
511521 }
512522
libavcodec/roqaudioenc.c+69−32
@@ -25,9 +25,8 @@ · 24 unmodified lines
2525 #include "avcodec.h"
2626 #include "bytestream.h"
2727
28−#define ROQ_FIRST_FRAME_SIZE (735*8)
2928 #define ROQ_FRAME_SIZE 735
30−
29+#define ROQ_HEADER_SIZE 8
3130
3231 #define MAX_DPCM (127*127)
3332
@@ -35,34 +34,59 @@ · 1 unmodified line
3534 typedef struct
3635 {
3736 short lastSample[2];
37+ int input_frames;
38+ int buffered_samples;
39+ int16_t *frame_buffer;
3840 } ROQDPCMContext;
3941
42+
43+static av_cold int roq_dpcm_encode_close(AVCodecContext *avctx)
44+{
45+ ROQDPCMContext *context = avctx->priv_data;
46+
47+ av_freep(&avctx->coded_frame);
48+ av_freep(&context->frame_buffer);
49+
50+ return 0;
51+}
52+
4053 static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
4154 {
4255 ROQDPCMContext *context = avctx->priv_data;
56+ int ret;
4357
4458 if (avctx->channels > 2) {
4559 av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n");
46− return -1;
60+ return AVERROR(EINVAL);
4761 }
4862 if (avctx->sample_rate != 22050) {
4963 av_log(avctx, AV_LOG_ERROR, "Audio must be 22050 Hz\n");
50− return -1;
51− }
52− if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
53− av_log(avctx, AV_LOG_ERROR, "Audio must be signed 16-bit\n");
54− return -1;
64+ return AVERROR(EINVAL);
5565 }
5666
57− avctx->frame_size = ROQ_FIRST_FRAME_SIZE;
67+ avctx->frame_size = ROQ_FRAME_SIZE;
68+ avctx->bit_rate = (ROQ_HEADER_SIZE + ROQ_FRAME_SIZE * avctx->channels) *
69+ (22050 / ROQ_FRAME_SIZE) * 8;
70+
71+ context->frame_buffer = av_malloc(8 * ROQ_FRAME_SIZE * avctx->channels *
72+ sizeof(*context->frame_buffer));
73+ if (!context->frame_buffer) {
74+ ret = AVERROR(ENOMEM);
75+ goto error;
76+ }
5877
5978 context->lastSample[0] = context->lastSample[1] = 0;
6079
6180 avctx->coded_frame= avcodec_alloc_frame();
62− if (!avctx->coded_frame)
63− return AVERROR(ENOMEM);
81+ if (!avctx->coded_frame) {
82+ ret = AVERROR(ENOMEM);
83+ goto error;
84+ }
6485
6586 return 0;
87+error:
88+ roq_dpcm_encode_close(avctx);
89+ return ret;
6690 }
6791
6892 static unsigned char dpcm_predict(short *previous, short current)
@@ -108,25 +132,45 @@ static unsigned char dpcm_predict(short *previous, short current) · 39 unmodified lines
108132 static int roq_dpcm_encode_frame(AVCodecContext *avctx,
109133 unsigned char *frame, int buf_size, void *data)
110134 {
111− int i, samples, stereo, ch;
112− const short *in;
113− unsigned char *out;
114−
135+ int i, stereo, data_size;
136+ const int16_t *in = data;
137+ uint8_t *out = frame;
115138 ROQDPCMContext *context = avctx->priv_data;
116139
117140 stereo = (avctx->channels == 2);
118141
142+ if (!data && context->input_frames >= 8)
143+ return 0;
144+
145+ if (data && context->input_frames < 8) {
146+ memcpy(&context->frame_buffer[context->buffered_samples * avctx->channels],
147+ in, avctx->frame_size * avctx->channels * sizeof(*in));
148+ context->buffered_samples += avctx->frame_size;
149+ if (context->input_frames < 7) {
150+ context->input_frames++;
151+ return 0;
152+ }
153+ in = context->frame_buffer;
154+ }
155+
119156 if (stereo) {
120157 context->lastSample[0] &= 0xFF00;
121158 context->lastSample[1] &= 0xFF00;
122159 }
123160
124− out = frame;
125− in = data;
161+ if (context->input_frames == 7 || !data)
162+ data_size = avctx->channels * context->buffered_samples;
163+ else
164+ data_size = avctx->channels * avctx->frame_size;
165+
166+ if (buf_size < ROQ_HEADER_SIZE + data_size) {
167+ av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n");
168+ return AVERROR(EINVAL);
169+ }
126170
127171 bytestream_put_byte(&out, stereo ? 0x21 : 0x20);
128172 bytestream_put_byte(&out, 0x10);
129− bytestream_put_le32(&out, avctx->frame_size*avctx->channels);
173+ bytestream_put_le32(&out, data_size);
130174
131175 if (stereo) {
132176 bytestream_put_byte(&out, (context->lastSample[1])>>8);
@@ -135,23 +179,15 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, · 2 unmodified lines
135179 bytestream_put_le16(&out, context->lastSample[0]);
136180
137181 /* Write the actual samples */
138− samples = avctx->frame_size;
139− for (i=0; i<samples; i++)
140− for (ch=0; ch<avctx->channels; ch++)
141− *out++ = dpcm_predict(&context->lastSample[ch], *in++);
182+ for (i = 0; i < data_size; i++)
183+ *out++ = dpcm_predict(&context->lastSample[i & 1], *in++);
142184
143− /* Use smaller frames from now on */
144− avctx->frame_size = ROQ_FRAME_SIZE;
185+ context->input_frames++;
186+ if (!data)
187+ context->input_frames = FFMAX(context->input_frames, 8);
145188
146189 /* Return the result size */
147− return out - frame;
148−}
149−
150−static av_cold int roq_dpcm_encode_close(AVCodecContext *avctx)
151−{
152− av_freep(&avctx->coded_frame);
153−
154− return 0;
190+ return ROQ_HEADER_SIZE + data_size;
155191 }
156192
157193 AVCodec ff_roq_dpcm_encoder = {
@@ -162,6 +198,7 @@ AVCodec ff_roq_dpcm_encoder = { · 4 unmodified lines
162198 .init = roq_dpcm_encode_init,
163199 .encode = roq_dpcm_encode_frame,
164200 .close = roq_dpcm_encode_close,
201+ .capabilities = CODEC_CAP_DELAY,
165202 .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
166203 .long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"),
167204 };
libavcodec/utils.c+7−5
@@ -603,6 +603,8 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){ · 602 unmodified lines
603603 return s->get_buffer(s, pic);
604604 }
605605
606+ assert(s->pix_fmt == pic->pix_fmt);
607+
606608 /* If internal buffer type return the same buffer */
607609 if(pic->type == FF_BUFFER_TYPE_INTERNAL) {
608610 return 0;
@@ -967,6 +969,8 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, · 358 unmodified lines
967969 int user_packet = !!avpkt->data;
968970 int nb_samples;
969971
972+ *got_packet_ptr = 0;
973+
970974 if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
971975 av_init_packet(avpkt);
972976 avpkt->size = 0;
@@ -988,7 +992,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, · 15 unmodified lines
988992 }
989993
990994 if (avctx->codec->encode2) {
991− *got_packet_ptr = 0;
992995 ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
993996 if (!ret && *got_packet_ptr) {
994997 if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
@@ -1196,10 +1199,11 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, · 201 unmodified lines
11961199 int ret;
11971200 int user_packet = !!avpkt->data;
11981201
1202+ *got_packet_ptr = 0;
1203+
11991204 if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
12001205 av_init_packet(avpkt);
12011206 avpkt->size = 0;
1202− *got_packet_ptr = 0;
12031207 return 0;
12041208 }
12051209
@@ -1208,17 +1212,15 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, · 2 unmodified lines
12081212
12091213 av_assert0(avctx->codec->encode2);
12101214
1211− *got_packet_ptr = 0;
12121215 ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
12131216 if (!ret) {
12141217 if (!*got_packet_ptr)
12151218 avpkt->size = 0;
12161219 else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
12171220 avpkt->pts = avpkt->dts = frame->pts;
1218− }
12191221
1220− if (!ret)
12211222 avctx->frame_number++;
1223+ }
12221224
12231225 emms_c();
12241226 return ret;
libavcodec/vorbisdec.c+12−0
@@ -1710,6 +1710,17 @@ static av_cold int vorbis_decode_close(AVCodecContext *avccontext) · 1709 unmodified lines
17101710 return 0;
17111711 }
17121712
1713+static av_cold void vorbis_decode_flush(AVCodecContext *avccontext)
1714+{
1715+ vorbis_context *vc = avccontext->priv_data;
1716+
1717+ if (vc->saved) {
1718+ memset(vc->saved, 0, (vc->blocksize[1] / 4) * vc->audio_channels *
1719+ sizeof(*vc->saved));
1720+ }
1721+ vc->previous_window = 0;
1722+}
1723+
17131724 AVCodec ff_vorbis_decoder = {
17141725 .name = "vorbis",
17151726 .type = AVMEDIA_TYPE_AUDIO,
@@ -1718,6 +1729,7 @@ AVCodec ff_vorbis_decoder = { · 2 unmodified lines
17181729 .init = vorbis_decode_init,
17191730 .close = vorbis_decode_close,
17201731 .decode = vorbis_decode_frame,
1732+ .flush = vorbis_decode_flush,
17211733 .capabilities = CODEC_CAP_DR1,
17221734 .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
17231735 .channel_layouts = ff_vorbis_channel_layouts,
libavcodec/vorbisenc.c+92−36
@@ -155,7 +155,7 @@ static int cb_lookup_vals(int lookup, int dimentions, int entries) · 154 unmodified lines
155155 return 0;
156156 }
157157
158−static void ready_codebook(vorbis_enc_codebook *cb)
158+static int ready_codebook(vorbis_enc_codebook *cb)
159159 {
160160 int i;
161161
@@ -167,6 +167,8 @@ static void ready_codebook(vorbis_enc_codebook *cb) · 5 unmodified lines
167167 int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
168168 cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
169169 cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
170+ if (!cb->dimentions || !cb->pow2)
171+ return AVERROR(ENOMEM);
170172 for (i = 0; i < cb->nentries; i++) {
171173 float last = 0;
172174 int j;
@@ -187,13 +189,16 @@ static void ready_codebook(vorbis_enc_codebook *cb) · 14 unmodified lines
187189 cb->pow2[i] /= 2.;
188190 }
189191 }
192+ return 0;
190193 }
191194
192−static void ready_residue(vorbis_enc_residue *rc, vorbis_enc_context *venc)
195+static int ready_residue(vorbis_enc_residue *rc, vorbis_enc_context *venc)
193196 {
194197 int i;
195198 assert(rc->type == 2);
196199 rc->maxes = av_mallocz(sizeof(float[2]) * rc->classifications);
200+ if (!rc->maxes)
201+ return AVERROR(ENOMEM);
197202 for (i = 0; i < rc->classifications; i++) {
198203 int j;
199204 vorbis_enc_codebook * cb;
@@ -223,15 +228,16 @@ static void ready_residue(vorbis_enc_residue *rc, vorbis_enc_context *venc) · 23 unmodified lines
223228 rc->maxes[i][0] += 0.8;
224229 rc->maxes[i][1] += 0.8;
225230 }
231+ return 0;
226232 }
227233
228−static void create_vorbis_context(vorbis_enc_context *venc,
229− AVCodecContext *avccontext)
234+static int create_vorbis_context(vorbis_enc_context *venc,
235+ AVCodecContext *avccontext)
230236 {
231237 vorbis_enc_floor *fc;
232238 vorbis_enc_residue *rc;
233239 vorbis_enc_mapping *mc;
234− int i, book;
240+ int i, book, ret;
235241
236242 venc->channels = avccontext->channels;
237243 venc->sample_rate = avccontext->sample_rate;
@@ -239,6 +245,8 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 1 unmodified line
239245
240246 venc->ncodebooks = FF_ARRAY_ELEMS(cvectors);
241247 venc->codebooks = av_malloc(sizeof(vorbis_enc_codebook) * venc->ncodebooks);
248+ if (!venc->codebooks)
249+ return AVERROR(ENOMEM);
242250
243251 // codebook 0..14 - floor1 book, values 0..255
244252 // codebook 15 residue masterbook
@@ -255,27 +263,36 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 10 unmodified lines
255263
256264 cb->lens = av_malloc(sizeof(uint8_t) * cb->nentries);
257265 cb->codewords = av_malloc(sizeof(uint32_t) * cb->nentries);
266+ if (!cb->lens || !cb->codewords)
267+ return AVERROR(ENOMEM);
258268 memcpy(cb->lens, cvectors[book].clens, cvectors[book].len);
259269 memset(cb->lens + cvectors[book].len, 0, cb->nentries - cvectors[book].len);
260270
261271 if (cb->lookup) {
262272 vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
263273 cb->quantlist = av_malloc(sizeof(int) * vals);
274+ if (!cb->quantlist)
275+ return AVERROR(ENOMEM);
264276 for (i = 0; i < vals; i++)
265277 cb->quantlist[i] = cvectors[book].quant[i];
266278 } else {
267279 cb->quantlist = NULL;
268280 }
269− ready_codebook(cb);
281+ if ((ret = ready_codebook(cb)) < 0)
282+ return ret;
270283 }
271284
272285 venc->nfloors = 1;
273286 venc->floors = av_malloc(sizeof(vorbis_enc_floor) * venc->nfloors);
287+ if (!venc->floors)
288+ return AVERROR(ENOMEM);
274289
275290 // just 1 floor
276291 fc = &venc->floors[0];
277292 fc->partitions = NUM_FLOOR_PARTITIONS;
278293 fc->partition_to_class = av_malloc(sizeof(int) * fc->partitions);
294+ if (!fc->partition_to_class)
295+ return AVERROR(ENOMEM);
279296 fc->nclasses = 0;
280297 for (i = 0; i < fc->partitions; i++) {
281298 static const int a[] = {0, 1, 2, 2, 3, 3, 4, 4};
@@ -284,6 +301,8 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 2 unmodified lines
284301 }
285302 fc->nclasses++;
286303 fc->classes = av_malloc(sizeof(vorbis_enc_floor_class) * fc->nclasses);
304+ if (!fc->classes)
305+ return AVERROR(ENOMEM);
287306 for (i = 0; i < fc->nclasses; i++) {
288307 vorbis_enc_floor_class * c = &fc->classes[i];
289308 int j, books;
@@ -292,6 +311,8 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 2 unmodified lines
292311 c->masterbook = floor_classes[i].masterbook;
293312 books = (1 << c->subclass);
294313 c->books = av_malloc(sizeof(int) * books);
314+ if (!c->books)
315+ return AVERROR(ENOMEM);
295316 for (j = 0; j < books; j++)
296317 c->books[j] = floor_classes[i].nbooks[j];
297318 }
@@ -303,6 +324,8 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 5 unmodified lines
303324 fc->values += fc->classes[fc->partition_to_class[i]].dim;
304325
305326 fc->list = av_malloc(sizeof(vorbis_floor1_entry) * fc->values);
327+ if (!fc->list)
328+ return AVERROR(ENOMEM);
306329 fc->list[0].x = 0;
307330 fc->list[1].x = 1 << fc->rangebits;
308331 for (i = 2; i < fc->values; i++) {
@@ -317,6 +340,8 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 8 unmodified lines
317340
318341 venc->nresidues = 1;
319342 venc->residues = av_malloc(sizeof(vorbis_enc_residue) * venc->nresidues);
343+ if (!venc->residues)
344+ return AVERROR(ENOMEM);
320345
321346 // single residue
322347 rc = &venc->residues[0];
@@ -327,6 +352,8 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 4 unmodified lines
327352 rc->classifications = 10;
328353 rc->classbook = 15;
329354 rc->books = av_malloc(sizeof(*rc->books) * rc->classifications);
355+ if (!rc->books)
356+ return AVERROR(ENOMEM);
330357 {
331358 static const int8_t a[10][8] = {
332359 { -1, -1, -1, -1, -1, -1, -1, -1, },
@@ -342,19 +369,26 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 9 unmodified lines
342369 };
343370 memcpy(rc->books, a, sizeof a);
344371 }
345− ready_residue(rc, venc);
372+ if ((ret = ready_residue(rc, venc)) < 0)
373+ return ret;
346374
347375 venc->nmappings = 1;
348376 venc->mappings = av_malloc(sizeof(vorbis_enc_mapping) * venc->nmappings);
377+ if (!venc->mappings)
378+ return AVERROR(ENOMEM);
349379
350380 // single mapping
351381 mc = &venc->mappings[0];
352382 mc->submaps = 1;
353383 mc->mux = av_malloc(sizeof(int) * venc->channels);
384+ if (!mc->mux)
385+ return AVERROR(ENOMEM);
354386 for (i = 0; i < venc->channels; i++)
355387 mc->mux[i] = 0;
356388 mc->floor = av_malloc(sizeof(int) * mc->submaps);
357389 mc->residue = av_malloc(sizeof(int) * mc->submaps);
390+ if (!mc->floor || !mc->residue)
391+ return AVERROR(ENOMEM);
358392 for (i = 0; i < mc->submaps; i++) {
359393 mc->floor[i] = 0;
360394 mc->residue[i] = 0;
@@ -362,6 +396,8 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 1 unmodified line
362396 mc->coupling_steps = venc->channels == 2 ? 1 : 0;
363397 mc->magnitude = av_malloc(sizeof(int) * mc->coupling_steps);
364398 mc->angle = av_malloc(sizeof(int) * mc->coupling_steps);
399+ if (!mc->magnitude || !mc->angle)
400+ return AVERROR(ENOMEM);
365401 if (mc->coupling_steps) {
366402 mc->magnitude[0] = 0;
367403 mc->angle[0] = 1;
@@ -369,6 +405,8 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 1 unmodified line
369405
370406 venc->nmodes = 1;
371407 venc->modes = av_malloc(sizeof(vorbis_enc_mode) * venc->nmodes);
408+ if (!venc->modes)
409+ return AVERROR(ENOMEM);
372410
373411 // single mode
374412 venc->modes[0].blockflag = 0;
@@ -379,12 +417,18 @@ static void create_vorbis_context(vorbis_enc_context *venc, · 4 unmodified lines
379417 venc->samples = av_malloc(sizeof(float) * venc->channels * (1 << venc->log2_blocksize[1]));
380418 venc->floor = av_malloc(sizeof(float) * venc->channels * (1 << venc->log2_blocksize[1]) / 2);
381419 venc->coeffs = av_malloc(sizeof(float) * venc->channels * (1 << venc->log2_blocksize[1]) / 2);
420+ if (!venc->saved || !venc->samples || !venc->floor || !venc->coeffs)
421+ return AVERROR(ENOMEM);
382422
383423 venc->win[0] = ff_vorbis_vwin[venc->log2_blocksize[0] - 6];
384424 venc->win[1] = ff_vorbis_vwin[venc->log2_blocksize[1] - 6];
385425
386− ff_mdct_init(&venc->mdct[0], venc->log2_blocksize[0], 0, 1.0);
387− ff_mdct_init(&venc->mdct[1], venc->log2_blocksize[1], 0, 1.0);
426+ if ((ret = ff_mdct_init(&venc->mdct[0], venc->log2_blocksize[0], 0, 1.0)) < 0)
427+ return ret;
428+ if ((ret = ff_mdct_init(&venc->mdct[1], venc->log2_blocksize[1], 0, 1.0)) < 0)
429+ return ret;
430+
431+ return 0;
388432 }
389433
390434 static void put_float(PutBitContext *pb, float f)
@@ -647,6 +691,8 @@ static int put_main_header(vorbis_enc_context *venc, uint8_t **out) · 256 unmodified lines
647691
648692 len = hlens[0] + hlens[1] + hlens[2];
649693 p = *out = av_mallocz(64 + len + len/255);
694+ if (!p)
695+ return AVERROR(ENOMEM);
650696
651697 *p++ = 2;
652698 p += av_xiphlacing(p, hlens[0]);
@@ -952,33 +998,6 @@ static int apply_window_and_mdct(vorbis_enc_context *venc, const signed short *a · 299 unmodified lines
952998 return 1;
953999 }
9541000
955−static av_cold int vorbis_encode_init(AVCodecContext *avccontext)
956−{
957− vorbis_enc_context *venc = avccontext->priv_data;
958−
959− if (avccontext->channels != 2) {
960− av_log(avccontext, AV_LOG_ERROR, "Current FFmpeg Vorbis encoder only supports 2 channels.\n");
961− return -1;
962− }
963−
964− create_vorbis_context(venc, avccontext);
965−
966− if (avccontext->flags & CODEC_FLAG_QSCALE)
967− venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA / 10.;
968− else
969− venc->quality = 0.03;
970− venc->quality *= venc->quality;
971−
972− avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);
973−
974− avccontext->frame_size = 1 << (venc->log2_blocksize[0] - 1);
975−
976− avccontext->coded_frame = avcodec_alloc_frame();
977− avccontext->coded_frame->key_frame = 1;
978−
979− return 0;
980−}
981−
9821001 static int vorbis_encode_frame(AVCodecContext *avccontext,
9831002 unsigned char *packets,
9841003 int buf_size, void *data)
@@ -1102,6 +1121,43 @@ static av_cold int vorbis_encode_close(AVCodecContext *avccontext) · 117 unmodified lines
11021121 return 0 ;
11031122 }
11041123
1124+static av_cold int vorbis_encode_init(AVCodecContext *avccontext)
1125+{
1126+ vorbis_enc_context *venc = avccontext->priv_data;
1127+ int ret;
1128+
1129+ if (avccontext->channels != 2) {
1130+ av_log(avccontext, AV_LOG_ERROR, "Current FFmpeg Vorbis encoder only supports 2 channels.\n");
1131+ return -1;
1132+ }
1133+
1134+ if ((ret = create_vorbis_context(venc, avccontext)) < 0)
1135+ goto error;
1136+
1137+ if (avccontext->flags & CODEC_FLAG_QSCALE)
1138+ venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA / 10.;
1139+ else
1140+ venc->quality = 0.03;
1141+ venc->quality *= venc->quality;
1142+
1143+ if ((ret = put_main_header(venc, (uint8_t**)&avccontext->extradata)) < 0)
1144+ goto error;
1145+ avccontext->extradata_size = ret;
1146+
1147+ avccontext->frame_size = 1 << (venc->log2_blocksize[0] - 1);
1148+
1149+ avccontext->coded_frame = avcodec_alloc_frame();
1150+ if (!avccontext->coded_frame) {
1151+ ret = AVERROR(ENOMEM);
1152+ goto error;
1153+ }
1154+
1155+ return 0;
1156+error:
1157+ vorbis_encode_close(avccontext);
1158+ return ret;
1159+}
1160+
11051161 AVCodec ff_vorbis_encoder = {
11061162 .name = "vorbis",
11071163 .type = AVMEDIA_TYPE_AUDIO,
libavcodec/xwdenc.c+4−2
@@ -44,7 +44,7 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 43 unmodified lines
4444 {
4545 enum PixelFormat pix_fmt = avctx->pix_fmt;
4646 uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;
47− uint32_t rgb[3] = { 0 };
47+ uint32_t rgb[3] = { 0 }, bitorder = 0;
4848 uint32_t header_size;
4949 int i, out_size, ret;
5050 uint8_t *ptr, *buf;
@@ -133,6 +133,8 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 82 unmodified lines
133133 ncolors = 256;
134134 break;
135135 case PIX_FMT_MONOWHITE:
136+ be = 1;
137+ bitorder = 1;
136138 bpp = 1;
137139 bpad = 8;
138140 vclass = XWD_STATIC_GRAY;
@@ -164,7 +166,7 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 25 unmodified lines
164166 bytestream_put_be32(&buf, 0); // bitmap x offset
165167 bytestream_put_be32(&buf, be); // byte order
166168 bytestream_put_be32(&buf, 32); // bitmap unit
167− bytestream_put_be32(&buf, be); // bit-order of image data
169+ bytestream_put_be32(&buf, bitorder); // bit-order of image data
168170 bytestream_put_be32(&buf, bpad); // bitmap scan-line pad in bits
169171 bytestream_put_be32(&buf, bpp); // bits per pixel
170172 bytestream_put_be32(&buf, lsize); // bytes per scan-line
libavformat/matroskadec.c+8−5
@@ -697,16 +697,19 @@ static int ebml_read_float(AVIOContext *pb, int size, double *num) · 696 unmodified lines
697697 */
698698 static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
699699 {
700− av_free(*str);
700+ char *res;
701+
701702 /* EBML strings are usually not 0-terminated, so we allocate one
702703 * byte more, read the string and NULL-terminate it ourselves. */
703− if (!(*str = av_malloc(size + 1)))
704+ if (!(res = av_malloc(size + 1)))
704705 return AVERROR(ENOMEM);
705− if (avio_read(pb, (uint8_t *) *str, size) != size) {
706− av_freep(str);
706+ if (avio_read(pb, (uint8_t *) res, size) != size) {
707+ av_free(res);
707708 return AVERROR(EIO);
708709 }
709− (*str)[size] = '\0';
710+ (res)[size] = '\0';
711+ av_free(*str);
712+ *str = res;
710713
711714 return 0;
712715 }
libavutil/avutil.h+1−1
@@ -154,7 +154,7 @@ · 153 unmodified lines
154154 */
155155
156156 #define LIBAVUTIL_VERSION_MAJOR 51
157−#define LIBAVUTIL_VERSION_MINOR 40
157+#define LIBAVUTIL_VERSION_MINOR 41
158158 #define LIBAVUTIL_VERSION_MICRO 100
159159
160160 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
libavutil/error.c+1−0
@@ -41,6 +41,7 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size) · 40 unmodified lines
4141 case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break;
4242 case AVERROR_PROTOCOL_NOT_FOUND:errstr = "Protocol not found" ; break;
4343 case AVERROR_STREAM_NOT_FOUND: errstr = "Stream not found" ; break;
44+ case AVERROR_UNKNOWN: errstr = "Unknown error occurred" ; break;
4445 }
4546
4647 if (errstr) {
libavutil/error.h+1−0
@@ -64,6 +64,7 @@ · 63 unmodified lines
6464 * it has been introduced in Libav after our AVERROR_BUG and with a modified value.
6565 */
6666 #define AVERROR_BUG2 (-MKTAG( 'B','U','G',' '))
67+#define AVERROR_UNKNOWN (-MKTAG( 'U','N','K','N')) ///< Unknown error, typically from an external library
6768
6869 /**
6970 * Put a description of the AVERROR code errnum in errbuf.
tests/Makefile+1−0
@@ -46,6 +46,7 @@ include $(SRC_PATH)/tests/fate/amrnb.mak · 45 unmodified lines
4646 include $(SRC_PATH)/tests/fate/amrwb.mak
4747 include $(SRC_PATH)/tests/fate/atrac.mak
4848 include $(SRC_PATH)/tests/fate/audio.mak
49+include $(SRC_PATH)/tests/fate/cdxl.mak
4950 include $(SRC_PATH)/tests/fate/dct.mak
5051 include $(SRC_PATH)/tests/fate/demux.mak
5152 include $(SRC_PATH)/tests/fate/dfa.mak
tests/fate/cdxl.mak+14−0
@@ -0,0 +1,14 @@
1+FATE_CDXL += fate-cdxl-ham6
2+fate-cdxl-ham6: CMD = framecrc -i $(SAMPLES)/cdxl/cat.cdxl -an -frames:v 16
3+
4+FATE_CDXL += fate-cdxl-ham8
5+fate-cdxl-ham8: CMD = framecrc -i $(SAMPLES)/cdxl/mirage.cdxl -an -frames:v 1
6+
7+FATE_CDXL += fate-cdxl-pal8
8+fate-cdxl-pal8: CMD = framecrc -i $(SAMPLES)/cdxl/maku.cdxl -pix_fmt rgb24 -frames:v 11
9+
10+FATE_CDXL += fate-cdxl-pal8-small
11+fate-cdxl-pal8-small: CMD = framecrc -i $(SAMPLES)/cdxl/fruit.cdxl -an -pix_fmt rgb24 -frames:v 46
12+
13+FATE_TESTS += $(FATE_CDXL)
14+fate-cdxl: $(FATE_CDXL)
tests/ref/fate/cdxl-ham6+17−0
@@ -0,0 +1,17 @@
1+#tb 0: 52/525
2+0, 0, 0, 1, 57600, 0x87887a7b
3+0, 1, 1, 1, 57600, 0x10c301d2
4+0, 2, 2, 1, 57600, 0xd1a6f910
5+0, 3, 3, 1, 57600, 0x20242bb9
6+0, 4, 4, 1, 57600, 0xae33cb7f
7+0, 5, 5, 1, 57600, 0x501b82c8
8+0, 6, 6, 1, 57600, 0x84199043
9+0, 7, 7, 1, 57600, 0x946a6dbb
10+0, 8, 8, 1, 57600, 0xeacea671
11+0, 9, 9, 1, 57600, 0x77b8723f
12+0, 10, 10, 1, 57600, 0x371cdb09
13+0, 11, 11, 1, 57600, 0xa16ef5ee
14+0, 12, 12, 1, 57600, 0xcb6abd9e
15+0, 13, 13, 1, 57600, 0xb73e800f
16+0, 14, 14, 1, 57600, 0x368bd93e
17+0, 15, 15, 1, 57600, 0xcde72dc5
tests/ref/fate/cdxl-ham8+2−0
@@ -0,0 +1,2 @@
1+#tb 0: 3/158
2+0, 0, 0, 1, 67584, 0xce0cade5
tests/ref/fate/cdxl-pal8+12−0
@@ -0,0 +1,12 @@
1+#tb 0: 12/601
2+0, 0, 0, 1, 67584, 0x5eae629b
3+0, 1, 1, 1, 67584, 0x32591227
4+0, 2, 2, 1, 67584, 0x4e4424c7
5+0, 3, 3, 1, 67584, 0x70db0134
6+0, 4, 4, 1, 67584, 0x3550ed0b
7+0, 5, 5, 1, 67584, 0x86fe3eef
8+0, 6, 6, 1, 67584, 0x3414bb33
9+0, 7, 7, 1, 67584, 0x667bfb91
10+0, 8, 8, 1, 67584, 0x6e1a4ccb
11+0, 9, 9, 1, 67584, 0xf723f9ae
12+0, 10, 10, 1, 67584, 0x88481d5d
tests/ref/fate/cdxl-pal8-small+47−0
@@ -0,0 +1,47 @@
1+#tb 0: 368/11025
2+0, 0, 0, 1, 30720, 0x0d552cfd
3+0, 1, 1, 1, 30720, 0x3cf93291
4+0, 2, 2, 1, 30720, 0xe45b2868
5+0, 3, 3, 1, 30720, 0xb5df289b
6+0, 4, 4, 1, 30720, 0x2562259e
7+0, 5, 5, 1, 30720, 0xbf171878
8+0, 6, 6, 1, 30720, 0x695b1d73
9+0, 7, 7, 1, 30720, 0x89ef1614
10+0, 8, 8, 1, 30720, 0xe12a1dd9
11+0, 9, 9, 1, 30720, 0x49622ffa
12+0, 10, 10, 1, 30720, 0xd6832703
13+0, 11, 11, 1, 30720, 0xec1d0cb7
14+0, 12, 12, 1, 30720, 0x8bee0525
15+0, 13, 13, 1, 30720, 0x1e0cf0c4
16+0, 14, 14, 1, 30720, 0xf83fd9db
17+0, 15, 15, 1, 30720, 0xffb0d6ab
18+0, 16, 16, 1, 30720, 0xe37fe239
19+0, 17, 17, 1, 30720, 0x74b0f856
20+0, 18, 18, 1, 30720, 0x9c88d3e1
21+0, 19, 19, 1, 30720, 0x714db368
22+0, 20, 20, 1, 30720, 0x6c8e8860
23+0, 21, 21, 1, 30720, 0x804968e6
24+0, 22, 22, 1, 30720, 0x7ac56ae4
25+0, 23, 23, 1, 30720, 0xffd85cbf
26+0, 24, 24, 1, 30720, 0x1f8455f9
27+0, 25, 25, 1, 30720, 0x3ae65296
28+0, 26, 26, 1, 30720, 0x9e544ecd
29+0, 27, 27, 1, 30720, 0x35678e5a
30+0, 28, 28, 1, 30720, 0x04bae866
31+0, 29, 29, 1, 30720, 0xb126ed94
32+0, 30, 30, 1, 30720, 0x1720efc5
33+0, 31, 31, 1, 30720, 0x4c1b01c2
34+0, 32, 32, 1, 30720, 0xd0a1e866
35+0, 33, 33, 1, 30720, 0x0d330789
36+0, 34, 34, 1, 30720, 0xf5ac08bb
37+0, 35, 35, 1, 30720, 0x9abe0d83
38+0, 36, 36, 1, 30720, 0xa44c02f4
39+0, 37, 37, 1, 30720, 0xdc4cc688
40+0, 38, 38, 1, 30720, 0x22eef3c1
41+0, 39, 39, 1, 30720, 0xcfbc0d1d
42+0, 40, 40, 1, 30720, 0x7104ea31
43+0, 41, 41, 1, 30720, 0x80daecfb
44+0, 42, 42, 1, 30720, 0xe1bab995
45+0, 43, 43, 1, 30720, 0x43f4b896
46+0, 44, 44, 1, 30720, 0xa0d2bf5c
47+0, 45, 45, 1, 30720, 0x3556a114
tests/ref/lavf/xwd+1−1
@@ -1,3 +1,3 @@
1−0ab6cd4fe5fe85a3f3e87508c2eadfa0 *./tests/data/images/xwd/02.xwd
1+50baa5560b7d1aa3188b19c1162bf7dc *./tests/data/images/xwd/02.xwd
22 ./tests/data/images/xwd/%02d.xwd CRC=0x6da01946
33 304239 ./tests/data/images/xwd/02.xwd

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t