History

Merge remote-tracking branch 'qatar/master'

* qatar/master: adtsenc: Check frame size. txd: Fix order of operations. APIchanges: fill in some blanks timer: fix misspelling of "decicycles" Eliminate pointless 0/NULL initializers in AVCodec and similar declarations. indeo3: cosmetics md5proto: Fix order of operations. dca: Replace oversized unused get_bits() with skip_bits_long(). Conflicts: doc/APIchanges libavformat/mmsh.c

Michael Niedermayer committed 14 years ago

Commit 4dcd1a32 parents 4b03d96 ac47e0126 files · +34 −47Browse files

Unified · Split

26 files
  1. doc/APIchanges +6 −6
  2. libavcodec/dca.c +2 −2
  3. libavcodec/dxva2_h264.c +0 −1
  4. libavcodec/dxva2_mpeg2.c +0 −1
  5. libavcodec/dxva2_vc1.c +0 −2
  6. libavcodec/indeo3.c +1 −1
  7. libavcodec/mjpeg2jpeg_bsf.c +0 −1
  8. libavcodec/s302m.c +0 −1
  9. libavcodec/txd.c +2 −1
  10. libavcodec/vaapi_h264.c +0 −2
  11. libavcodec/vaapi_mpeg2.c +0 −2
  12. libavcodec/vaapi_mpeg4.c +0 −4
  13. libavcodec/vaapi_vc1.c +0 −4
  14. libavcodec/vda_h264.c +0 −1
  15. libavformat/a64.c +0 −1
  16. libavformat/adtsenc.c +14 −2
  17. libavformat/amr.c +0 −1
  18. libavformat/md5proto.c +1 −1
  19. libavformat/mmsh.c +0 −1
  20. libavformat/mpeg.c +0 −1
  21. libavformat/mpegtsenc.c +7 −2
  22. libavformat/rsodec.c +0 −3
  23. libavformat/rsoenc.c +0 −1
  24. libavformat/rtpdec_mpeg4.c +0 −3
  25. libavformat/tls.c +0 −1
  26. libavutil/timer.h +1 −1
doc/APIchanges+6−6
@@ -22,14 +22,14 @@ API changes, most recent first: · 21 unmodified lines
2222 2011-10-20 - b35e9e1 - lavu 51.22.0
2323 Add av_strtok() to avstring.h.
2424
25−2011-xx-xx - xxxxxxx - lavu 51.18.0
25+2011-11-23 - bbb46f3 - lavu 51.18.0
2626 Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and
2727 av_samples_alloc(), to samplefmt.h.
2828
29−2011-xx-xx - xxxxxxx - lavu 51.17.0
29+2011-11-23 - 8889cc4 - lavu 51.17.0
3030 Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h.
3131
32−2011-xx-xx - xxxxxxx - lavc 53.21.0
32+2011-11-19 - f3a29b7 - lavc 53.21.0
3333 Move some AVCodecContext fields to a new private struct, AVCodecInternal,
3434 which is accessed from a new field, AVCodecContext.internal.
3535 - fields moved:
@@ -37,6 +37,9 @@ API changes, most recent first: · 1 unmodified line
3737 AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count
3838 AVCodecContext.is_copy --> AVCodecInternal.is_copy
3939
40+2011-11-16 - 6270671 - lavu 51.16.0
41+ Add av_timegm()
42+
4043 2011-11-13 - lavf 53.15.0
4144 New interrupt callback API, allowing per-AVFormatContext/AVIOContext
4245 interrupt callbacks.
@@ -47,9 +50,6 @@ API changes, most recent first: · 4 unmodified lines
4750 This will allow passing AVOptions to protocols after lavf
4851 54.0.
4952
50−2011-11-xx - xxxxxxx - lavu 51.16.0
51− Add av_timegm()
52−
5353 2011-11-06 - ba04ecf - lavu 51.14.0
5454 Add av_strcasecmp() and av_strncasecmp() to avstring.h.
5555
libavcodec/dca.c+2−2
@@ -519,7 +519,7 @@ static int dca_parse_frame_header(DCAContext * s) · 518 unmodified lines
519519 init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8);
520520
521521 /* Sync code */
522− get_bits(&s->gb, 32);
522+ skip_bits_long(&s->gb, 32);
523523
524524 /* Frame header */
525525 s->frame_type = get_bits(&s->gb, 1);
@@ -1257,7 +1257,7 @@ static int dca_subframe_footer(DCAContext * s, int base_channel) · 731 unmodified lines
12571257 /* presumably optional information only appears in the core? */
12581258 if (!base_channel) {
12591259 if (s->timestamp)
1260− get_bits(&s->gb, 32);
1260+ skip_bits_long(&s->gb, 32);
12611261
12621262 if (s->aux_data)
12631263 aux_data_count = get_bits(&s->gb, 6);
libavcodec/dxva2_h264.c+0−1
@@ -443,7 +443,6 @@ AVHWAccel ff_h264_dxva2_hwaccel = { · 442 unmodified lines
443443 .type = AVMEDIA_TYPE_VIDEO,
444444 .id = CODEC_ID_H264,
445445 .pix_fmt = PIX_FMT_DXVA2_VLD,
446− .capabilities = 0,
447446 .start_frame = start_frame,
448447 .decode_slice = decode_slice,
449448 .end_frame = end_frame,
libavcodec/dxva2_mpeg2.c+0−1
@@ -265,7 +265,6 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = { · 264 unmodified lines
265265 .type = AVMEDIA_TYPE_VIDEO,
266266 .id = CODEC_ID_MPEG2VIDEO,
267267 .pix_fmt = PIX_FMT_DXVA2_VLD,
268− .capabilities = 0,
269268 .start_frame = start_frame,
270269 .decode_slice = decode_slice,
271270 .end_frame = end_frame,
libavcodec/dxva2_vc1.c+0−2
@@ -269,7 +269,6 @@ AVHWAccel ff_wmv3_dxva2_hwaccel = { · 268 unmodified lines
269269 .type = AVMEDIA_TYPE_VIDEO,
270270 .id = CODEC_ID_WMV3,
271271 .pix_fmt = PIX_FMT_DXVA2_VLD,
272− .capabilities = 0,
273272 .start_frame = start_frame,
274273 .decode_slice = decode_slice,
275274 .end_frame = end_frame,
@@ -282,7 +281,6 @@ AVHWAccel ff_vc1_dxva2_hwaccel = { · 6 unmodified lines
282281 .type = AVMEDIA_TYPE_VIDEO,
283282 .id = CODEC_ID_VC1,
284283 .pix_fmt = PIX_FMT_DXVA2_VLD,
285− .capabilities = 0,
286284 .start_frame = start_frame,
287285 .decode_slice = decode_slice,
288286 .end_frame = end_frame,
libavcodec/indeo3.c+1−1
@@ -759,7 +759,7 @@ static int parse_bintree(Indeo3DecodeContext *ctx, AVCodecContext *avctx, · 758 unmodified lines
759759 av_log(avctx, AV_LOG_ERROR, "SkipCell procedure not implemented yet!\n");
760760
761761 CHECK_CELL
762− if(!curr_cell.mv_ptr)
762+ if (!curr_cell.mv_ptr)
763763 return AVERROR_INVALIDDATA;
764764 copy_cell(ctx, plane, &curr_cell);
765765 return 0;
libavcodec/mjpeg2jpeg_bsf.c+0−1
@@ -108,6 +108,5 @@ static int mjpeg2jpeg_filter(AVBitStreamFilterContext *bsfc, · 107 unmodified lines
108108
109109 AVBitStreamFilter ff_mjpeg2jpeg_bsf = {
110110 .name = "mjpeg2jpeg",
111− .priv_data_size = 0,
112111 .filter = mjpeg2jpeg_filter,
113112 };
libavcodec/s302m.c+0−1
@@ -144,7 +144,6 @@ AVCodec ff_s302m_decoder = { · 143 unmodified lines
144144 .name = "s302m",
145145 .type = AVMEDIA_TYPE_AUDIO,
146146 .id = CODEC_ID_S302M,
147− .priv_data_size = 0,
148147 .decode = s302m_decode_frame,
149148 .long_name = NULL_IF_CONFIG_SMALL("SMPTE 302M"),
150149 };
libavcodec/txd.c+2−1
@@ -116,7 +116,8 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 115 unmodified lines
116116 } else if (depth == 16) {
117117 switch (d3d_format) {
118118 case 0:
119− if (!flags&1) goto unsupported;
119+ if (!(flags & 1))
120+ goto unsupported;
120121 case FF_S3TC_DXT1:
121122 if (buf_end - cur < (w/4) * (h/4) * 8)
122123 return AVERROR_INVALIDDATA;
libavcodec/vaapi_h264.c+0−2
@@ -342,9 +342,7 @@ AVHWAccel ff_h264_vaapi_hwaccel = { · 341 unmodified lines
342342 .type = AVMEDIA_TYPE_VIDEO,
343343 .id = CODEC_ID_H264,
344344 .pix_fmt = PIX_FMT_VAAPI_VLD,
345− .capabilities = 0,
346345 .start_frame = start_frame,
347346 .end_frame = end_frame,
348347 .decode_slice = decode_slice,
349− .priv_data_size = 0,
350348 };
libavcodec/vaapi_mpeg2.c+0−2
@@ -143,9 +143,7 @@ AVHWAccel ff_mpeg2_vaapi_hwaccel = { · 142 unmodified lines
143143 .type = AVMEDIA_TYPE_VIDEO,
144144 .id = CODEC_ID_MPEG2VIDEO,
145145 .pix_fmt = PIX_FMT_VAAPI_VLD,
146− .capabilities = 0,
147146 .start_frame = vaapi_mpeg2_start_frame,
148147 .end_frame = vaapi_mpeg2_end_frame,
149148 .decode_slice = vaapi_mpeg2_decode_slice,
150− .priv_data_size = 0,
151149 };
libavcodec/vaapi_mpeg4.c+0−4
@@ -155,11 +155,9 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = { · 154 unmodified lines
155155 .type = AVMEDIA_TYPE_VIDEO,
156156 .id = CODEC_ID_MPEG4,
157157 .pix_fmt = PIX_FMT_VAAPI_VLD,
158− .capabilities = 0,
159158 .start_frame = vaapi_mpeg4_start_frame,
160159 .end_frame = vaapi_mpeg4_end_frame,
161160 .decode_slice = vaapi_mpeg4_decode_slice,
162− .priv_data_size = 0,
163161 };
164162 #endif
165163
@@ -169,10 +167,8 @@ AVHWAccel ff_h263_vaapi_hwaccel = { · 3 unmodified lines
169167 .type = AVMEDIA_TYPE_VIDEO,
170168 .id = CODEC_ID_H263,
171169 .pix_fmt = PIX_FMT_VAAPI_VLD,
172− .capabilities = 0,
173170 .start_frame = vaapi_mpeg4_start_frame,
174171 .end_frame = vaapi_mpeg4_end_frame,
175172 .decode_slice = vaapi_mpeg4_decode_slice,
176− .priv_data_size = 0,
177173 };
178174 #endif
libavcodec/vaapi_vc1.c+0−4
@@ -346,11 +346,9 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = { · 345 unmodified lines
346346 .type = AVMEDIA_TYPE_VIDEO,
347347 .id = CODEC_ID_WMV3,
348348 .pix_fmt = PIX_FMT_VAAPI_VLD,
349− .capabilities = 0,
350349 .start_frame = vaapi_vc1_start_frame,
351350 .end_frame = vaapi_vc1_end_frame,
352351 .decode_slice = vaapi_vc1_decode_slice,
353− .priv_data_size = 0,
354352 };
355353 #endif
356354
@@ -359,9 +357,7 @@ AVHWAccel ff_vc1_vaapi_hwaccel = { · 2 unmodified lines
359357 .type = AVMEDIA_TYPE_VIDEO,
360358 .id = CODEC_ID_VC1,
361359 .pix_fmt = PIX_FMT_VAAPI_VLD,
362− .capabilities = 0,
363360 .start_frame = vaapi_vc1_start_frame,
364361 .end_frame = vaapi_vc1_end_frame,
365362 .decode_slice = vaapi_vc1_decode_slice,
366− .priv_data_size = 0,
367363 };
libavcodec/vda_h264.c+0−1
@@ -86,7 +86,6 @@ AVHWAccel ff_h264_vda_hwaccel = { · 85 unmodified lines
8686 .type = AVMEDIA_TYPE_VIDEO,
8787 .id = CODEC_ID_H264,
8888 .pix_fmt = PIX_FMT_VDA_VLD,
89− .capabilities = 0,
9089 .start_frame = start_frame,
9190 .decode_slice = decode_slice,
9291 .end_frame = end_frame,
libavformat/a64.c+0−1
@@ -166,7 +166,6 @@ static int a64_write_trailer(struct AVFormatContext *s) · 165 unmodified lines
166166 AVOutputFormat ff_a64_muxer = {
167167 .name = "a64",
168168 .long_name = NULL_IF_CONFIG_SMALL("a64 - video for Commodore 64"),
169− .mime_type = NULL,
170169 .extensions = "a64, A64",
171170 .priv_data_size = sizeof (A64Context),
172171 .video_codec = CODEC_ID_A64_MULTI,
libavformat/adtsenc.c+14−2
@@ -27,6 +27,8 @@ · 26 unmodified lines
2727 #include "avformat.h"
2828 #include "adts.h"
2929
30+#define ADTS_MAX_FRAME_BYTES ((1 << 13) - 1)
31+
3032 int ff_adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf, int size)
3133 {
3234 GetBitContext gb;
@@ -93,6 +95,13 @@ int ff_adts_write_frame_header(ADTSContext *ctx, · 60 unmodified lines
9395 {
9496 PutBitContext pb;
9597
98+ unsigned full_frame_size = (unsigned)ADTS_HEADER_SIZE + size + pce_size;
99+ if (full_frame_size > ADTS_MAX_FRAME_BYTES) {
100+ av_log(NULL, AV_LOG_ERROR, "ADTS frame size too large: %u (max %d)\n",
101+ full_frame_size, ADTS_MAX_FRAME_BYTES);
102+ return AVERROR_INVALIDDATA;
103+ }
104+
96105 init_put_bits(&pb, buf, ADTS_HEADER_SIZE);
97106
98107 /* adts_fixed_header */
@@ -110,7 +119,7 @@ int ff_adts_write_frame_header(ADTSContext *ctx, · 11 unmodified lines
110119 /* adts_variable_header */
111120 put_bits(&pb, 1, 0); /* copyright_identification_bit */
112121 put_bits(&pb, 1, 0); /* copyright_identification_start */
113− put_bits(&pb, 13, ADTS_HEADER_SIZE + size + pce_size); /* aac_frame_length */
122+ put_bits(&pb, 13, full_frame_size); /* aac_frame_length */
114123 put_bits(&pb, 11, 0x7ff); /* adts_buffer_fullness */
115124 put_bits(&pb, 2, 0); /* number_of_raw_data_blocks_in_frame */
116125
@@ -128,7 +137,10 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt) · 11 unmodified lines
128137 if (!pkt->size)
129138 return 0;
130139 if (adts->write_adts) {
131− ff_adts_write_frame_header(adts, buf, pkt->size, adts->pce_size);
140+ int err = ff_adts_write_frame_header(adts, buf, pkt->size,
141+ adts->pce_size);
142+ if (err < 0)
143+ return err;
132144 avio_write(pb, buf, ADTS_HEADER_SIZE);
133145 if (adts->pce_size) {
134146 avio_write(pb, adts->pce_data, adts->pce_size);
libavformat/amr.c+0−1
@@ -176,7 +176,6 @@ static int amr_read_packet(AVFormatContext *s, · 175 unmodified lines
176176 AVInputFormat ff_amr_demuxer = {
177177 .name = "amr",
178178 .long_name = NULL_IF_CONFIG_SMALL("3GPP AMR file format"),
179− .priv_data_size = 0, /*priv_data_size*/
180179 .read_probe = amr_probe,
181180 .read_header = amr_read_header,
182181 .read_packet = amr_read_packet,
libavformat/md5proto.c+1−1
@@ -36,7 +36,7 @@ static int md5_open(URLContext *h, const char *filename, int flags) · 35 unmodified lines
3636 return -1;
3737 }
3838
39− if (!flags & AVIO_FLAG_WRITE)
39+ if (!(flags & AVIO_FLAG_WRITE))
4040 return AVERROR(EINVAL);
4141
4242 av_md5_init(h->priv_data);
libavformat/mmsh.c+0−1
@@ -406,7 +406,6 @@ URLProtocol ff_mmsh_protocol = { · 405 unmodified lines
406406 .name = "mmsh",
407407 .url_open = mmsh_open,
408408 .url_read = mmsh_read,
409− .url_write = NULL,
410409 .url_seek = mmsh_seek,
411410 .url_close = mmsh_close,
412411 .url_read_seek = mmsh_read_seek,
libavformat/mpeg.c+0−1
@@ -620,7 +620,6 @@ AVInputFormat ff_mpegps_demuxer = { · 619 unmodified lines
620620 .read_probe = mpegps_probe,
621621 .read_header = mpegps_read_header,
622622 .read_packet = mpegps_read_packet,
623− .read_seek = NULL, //mpegps_read_seek,
624623 .read_timestamp = mpegps_read_dts,
625624 .flags = AVFMT_SHOW_IDS|AVFMT_TS_DISCONT,
626625 };
libavformat/mpegtsenc.c+7−2
@@ -1006,7 +1006,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) · 1005 unmodified lines
10061006 return -1;
10071007 if ((AV_RB16(pkt->data) & 0xfff0) != 0xfff0) {
10081008 ADTSContext *adts = ts_st->adts;
1009− int new_size;
1009+ int new_size, err;
10101010 if (!adts) {
10111011 av_log(s, AV_LOG_ERROR, "aac bitstream not in adts format "
10121012 "and extradata missing\n");
@@ -1018,7 +1018,12 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) · 5 unmodified lines
10181018 data = av_malloc(new_size);
10191019 if (!data)
10201020 return AVERROR(ENOMEM);
1021− ff_adts_write_frame_header(adts, data, pkt->size, adts->pce_size);
1021+ err = ff_adts_write_frame_header(adts, data, pkt->size,
1022+ adts->pce_size);
1023+ if (err < 0) {
1024+ av_free(data);
1025+ return err;
1026+ }
10221027 if (adts->pce_size) {
10231028 memcpy(data+ADTS_HEADER_SIZE, adts->pce_data, adts->pce_size);
10241029 adts->pce_size = 0;
libavformat/rsodec.c+0−3
@@ -92,11 +92,8 @@ AVInputFormat ff_rso_demuxer = { · 91 unmodified lines
9292 .name = "rso",
9393 .long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO format"),
9494 .extensions = "rso",
95− .priv_data_size = 0,
96− .read_probe = NULL, /* no magic value in this format */
9795 .read_header = rso_read_header,
9896 .read_packet = rso_read_packet,
99− .read_close = NULL,
10097 .read_seek = pcm_read_seek,
10198 .codec_tag = (const AVCodecTag* const []){ff_codec_rso_tags, 0},
10299 };
libavformat/rsoenc.c+0−1
@@ -104,7 +104,6 @@ AVOutputFormat ff_rso_muxer = { · 103 unmodified lines
104104 .name = "rso",
105105 .long_name = NULL_IF_CONFIG_SMALL("Lego Mindstorms RSO format"),
106106 .extensions = "rso",
107− .priv_data_size = 0,
108107 .audio_codec = CODEC_ID_PCM_U8,
109108 .video_codec = CODEC_ID_NONE,
110109 .write_header = rso_write_header,
libavformat/rtpdec_mpeg4.c+0−3
@@ -234,9 +234,6 @@ RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler = { · 233 unmodified lines
234234 .codec_type = AVMEDIA_TYPE_VIDEO,
235235 .codec_id = CODEC_ID_MPEG4,
236236 .parse_sdp_a_line = parse_sdp_line,
237− .alloc = NULL,
238− .free = NULL,
239− .parse_packet = NULL
240237 };
241238
242239 RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler = {
libavformat/tls.c+0−1
@@ -246,7 +246,6 @@ URLProtocol ff_tls_protocol = { · 245 unmodified lines
246246 .url_open = tls_open,
247247 .url_read = tls_read,
248248 .url_write = tls_write,
249− .url_seek = NULL,
250249 .url_close = tls_close,
251250 .priv_data_size = sizeof(TLSContext),
252251 };
libavutil/timer.h+1−1
@@ -61,7 +61,7 @@ tend= AV_READ_TIME();\ · 60 unmodified lines
6161 }else\
6262 tskip_count++;\
6363 if(((tcount+tskip_count)&(tcount+tskip_count-1))==0){\
64− av_log(NULL, AV_LOG_ERROR, "%"PRIu64" dezicycles in %s, %d runs, %d skips\n",\
64+ av_log(NULL, AV_LOG_ERROR, "%"PRIu64" decicycles in %s, %d runs, %d skips\n",\
6565 tsum*10/tcount, id, tcount, tskip_count);\
6666 }\
6767 }

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