FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
Memory Management
Common utility functions

Macros

#define DECLARE_ALIGNED(n, t, v)   t v
 
#define DECLARE_ASM_CONST(n, t, v)   static const t v
 
#define av_malloc_attrib
 
#define av_alloc_size(...)
 

Functions

voidav_malloc (size_t size) av_malloc_attrib av_alloc_size(1)
 Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).
 
 av_alloc_size (1, 2) static inline void *av_malloc_array(size_t nmemb
 Helper function to allocate a block of size * nmemb bytes with using av_malloc()
 
return av_malloc (nmemb *size)
 
voidav_realloc (void *ptr, size_t size) av_alloc_size(2)
 Allocate or reallocate a block of memory.
 
voidav_realloc_f (void *ptr, size_t nelem, size_t elsize)
 Allocate or reallocate a block of memory.
 
 av_alloc_size (2, 3) void *av_realloc_array(void *ptr
 Allocate or reallocate an array.
 
void av_free (void *ptr)
 Free a memory block which has been allocated with av_malloc(z)() or av_realloc().
 
voidav_mallocz (size_t size) av_malloc_attrib av_alloc_size(1)
 Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.
 
voidav_calloc (size_t nmemb, size_t size) av_malloc_attrib
 Allocate a block of nmemb * size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.
 
return av_mallocz (nmemb *size)
 
char * av_strdup (const char *s) av_malloc_attrib
 Duplicate the string s.
 
voidav_memdup (const void *p, size_t size)
 Duplicate the buffer p.
 
void av_freep (void *ptr)
 Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer pointing to it to NULL.
 
void av_dynarray_add (void *tab_ptr, int *nb_ptr, void *elem)
 Add an element to a dynamic array.
 
voidav_dynarray2_add (void **tab_ptr, int *nb_ptr, size_t elem_size, const uint8_t *elem_data)
 Add an element of size elem_size to a dynamic array.
 
static int av_size_mult (size_t a, size_t b, size_t *r)
 Multiply two size_t values checking for overflow.
 
void av_max_alloc (size_t max)
 Set the maximum size that may me allocated in one block.
 
void av_memcpy_backptr (uint8_t *dst, int back, int cnt)
 deliberately overlapping memcpy implementation
 

Variables

size_t size
 
size_t nmemb
 

Detailed Description

Macro Definition Documentation

#define DECLARE_ALIGNED (   n,
  t,
  v 
)    t v
#define DECLARE_ASM_CONST (   n,
  t,
  v 
)    static const t v

Definition at line 60 of file mem.h.

#define av_malloc_attrib

Definition at line 66 of file mem.h.

#define av_alloc_size (   ...)

Definition at line 72 of file mem.h.

Function Documentation

void* av_malloc ( size_t  size)

Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).

Parameters
sizeSize in bytes for the memory block to be allocated.
Returns
Pointer to the allocated block, NULL if the block cannot be allocated.
See Also
av_mallocz()

Definition at line 73 of file mem.c.

Referenced by a64multi_init_encoder(), aacPlus_encode_init(), add_doubles_metadata(), add_file(), add_metadata(), add_shorts_metadata(), add_string_metadata(), adpcm_encode_init(), aic_decode_init(), alloc_scratch_buffers(), alloc_sequence_buffers(), allocate_buffers(), allocate_frame_buffers(), apc_read_header(), ape_read_header(), ape_tag_read_field(), append_entry(), asf_read_picture(), asf_write_header(), ass_decode_init(), ass_encode_init(), audio_encode_example(), av_asprintf(), av_audio_convert_alloc(), av_bprint_finalize(), av_buffer_alloc(), av_buffersink_params_alloc(), av_d2str(), av_expr_parse(), av_fft_init(), av_fifo_alloc(), av_file_map(), av_frame_new_side_data(), av_frame_ref(), av_get_token(), av_image_alloc(), av_malloc(), av_mallocz(), av_memdup(), av_opt_get(), av_opt_set_bin(), av_packet_new_side_data(), av_packet_split_side_data(), av_parser_change(), av_realloc(), av_samples_alloc(), av_strdup(), av_tempfile(), avcodec_alloc_context3(), avcodec_alloc_frame(), avfilter_ref_buffer(), avformat_alloc_context(), avformat_find_stream_info(), avi_read_header(), avi_read_tag(), avi_write_packet(), avisynth_read_packet_audio(), avisynth_read_packet_video(), avresample_set_matrix(), bfi_read_header(), build_filter(), calc_rice_params(), celt_header(), cmdutils_read_file(), cng_encode_init(), concat_open(), config(), config_input(), config_output(), config_props(), convert_str(), copy_parameter_set(), copy_video_props(), create_all_formats(), create_cel_evals(), create_map(), create_vorbis_context(), data_open(), decode_dvd_subtitles(), decode_frame(), decode_header_trees(), decode_init(), decode_main_header(), decode_picture_header(), decode_rle(), decode_slice(), denoise_depth(), dfa_read_header(), dnxhd_encode_init(), do_subtitle_out(), doubles2str(), dshow_add_device(), dshow_cycle_formats(), dtshd_read_header(), dump_extradata(), dup_wchar_to_utf8(), dvbsub_display_end_segment(), dvbsub_parse_clut_segment(), dvbsub_parse_init(), dvbsub_parse_region_segment(), dvdsub_parse(), dvdsub_parse_extradata(), ebml_read_ascii(), eightsvx_decode_frame(), encode_frame(), encode_init(), encode_intervals(), encode_picture_ls(), escape130_decode_init(), estimate_best_b_count(), extract_header(), Faac_encode_init(), ff_ac3_float_mdct_init(), ff_alsa_open(), ff_audio_data_realloc(), ff_bgmc_init(), ff_ccitt_unpack(), ff_dct_init(), ff_do_elbg(), ff_fast_malloc(), ff_fft_init(), ff_fill_line_with_color(), ff_filter_alloc(), ff_flac_parse_picture(), ff_gen_syncpoint_search(), ff_http_auth_create_response(), ff_huffyuv_alloc_temp(), ff_init_elbg(), ff_init_rl(), ff_init_vlc_sparse(), ff_jpeg2000_dwt_init(), ff_mdct_init(), ff_merge_channel_layouts(), ff_mjpeg_decode_sof(), ff_mjpeg_encode_init(), ff_mov_write_packet(), ff_mp_image_alloc_planes(), ff_MPV_common_frame_size_change(), ff_MPV_common_init(), ff_mss12_decode_init(), ff_parse_fmtp(), ff_parse_mpeg2_descriptor(), ff_pca_init(), ff_psy_init(), ff_rtmp_packet_create(), ff_rv34_decode_frame(), ff_sauce_read(), ff_slice_buffer_init(), ff_sndio_open(), ff_store_parser_state(), ff_tls_init(), ff_urldecode(), ff_vc1_decode_init_alloc_tables(), ff_vda_create_decoder(), ff_vorbis_comment(), ff_yuv2rgb_c_init_tables(), ffio_ensure_seekback(), ffio_fdopen(), ffio_set_buf_size(), ffm2_read_header(), ffm_read_header(), fft_ref_init(), ffurl_get_multi_file_handle(), ffv1_allocate_initial_states(), ffv1_init_slice_contexts(), ffv1_init_slice_state(), film_read_header(), film_read_packet(), find_and_decode_index(), find_headers_search_validate(), find_motion(), find_next_parse_unit(), find_smallest_bounding_rectangle(), flac_encode_init(), flac_header(), flac_write_block_comment(), flashsv_decode_frame(), flv_set_video_codec(), fourxm_read_header(), frame_list_add_frame(), frame_thread_init(), generate_codebook(), generate_dither_noise(), generate_new_codebooks(), get_buffer_internal(), get_codec_data(), get_cookies(), get_geokey_val(), get_key(), get_meta(), get_metadata(), get_stats(), get_tag(), getstr8(), gif_encode_init(), gif_write_packet(), guess_dc(), halfpel_interpol(), hls_read_header(), hls_write_header(), idcin_read_header(), iec61883_callback(), iff_read_header(), imx_dump_header(), init(), init_bundles(), init_coef_vlc(), init_cook_mlt(), init_er(), init_filter_param(), init_mv_table(), init_noise(), init_pass2(), init_pattern_from_file(), init_tiles(), initFilter(), interpolate(), interpolate_refplane(), iso88591_to_utf8(), ivi_init_tiles(), lag_decode_frame(), latm_decode_audio_specific_config(), lavfi_read_header(), libAVPin_Setup(), libopus_encode_init(), libschroedinger_decode_frame(), load_mask(), main(), make_digest_auth(), matroska_decode_buffer(), matroska_read_header(), mjpeg2jpeg_filter(), mjpeg_decode_com(), mjpega_dump_header(), mkv_strip_wavpack(), mmap_init(), mmap_read_frame(), modplug_read_header(), mov2textsub(), mov_create_timecode_track(), mov_metadata_raw(), mov_read_cmov(), mov_read_ctts(), mov_read_dref(), mov_read_ftyp(), mov_read_hdlr(), mov_read_sbgp(), mov_read_stco(), mov_read_stps(), mov_read_stsc(), mov_read_stss(), mov_read_stsz(), mov_read_stts(), mov_read_trun(), mov_write_ctts_tag(), mov_write_header(), mov_write_stts_tag(), mp3_header_compress(), mp3_header_decompress(), mp3lame_encode_init(), mpc8_parse_seektable(), mpc_read_header(), mpegps_read_pes_header(), mpegts_open_section_filter(), mpegts_set_stream_info(), mpegts_write_header(), mpegts_write_packet_internal(), mss3_decode_init(), mss4_decode_init(), mxf_read_generic_descriptor(), mxf_read_utf16_string(), mxpeg_decode_mxm(), new_connection(), noise(), nsv_parse_NSVf_header(), nut_read_header(), ogg_new_buf(), ogg_new_stream(), ogg_read_page(), ogg_save(), oggvorbis_encode_init(), ogm_header(), open_filter_param(), open_null_ctx(), open_output_file(), opus_header(), packet_queue_put_private(), parse_forced_key_frames(), parse_frames(), parse_MP4DecConfigDescrTag(), parse_options(), parse_packed_headers(), parse_playlist(), parse_presentation_segment(), parse_setup_header(), parse_times(), parse_vtrk(), pcx_decode_frame(), pp_get_context(), pp_get_mode_by_name_and_quality(), precalc_coefs(), prepare_sdp_description(), print_sdp(), process_line(), prores_encode_init(), qt_rtp_parse_packet(), queue_frames(), r3d_read_rdvo(), radix_sort(), read_ffserver_streams(), read_frame(), read_geobtag(), read_header(), read_header_gme(), read_shape_from_file(), read_specific_config(), ready_codebook(), recv_msg(), redspark_read_header(), rl2_read_header(), rm_read_extradata(), rm_write_audio(), roq_dpcm_encode_init(), roq_encode_init(), rsd_read_header(), rtmp_calc_swfhash(), rtmp_open(), rtp_get_multi_file_handle(), rtp_new_connection(), rtp_parse_mp4_au(), rtp_write_header(), rv34_decoder_alloc(), sample_queue_retain(), sdp_parse_fmtp_config_h264(), seq_init_frame_buffers(), set_string_binary(), shift_data(), shorts2str(), smacker_read_header(), smjpeg_read_header(), smush_read_header(), sox_read_header(), spdif_write_header(), speex_header(), Stagefright_decode_frame(), start_jack(), submit_stats(), sunrast_decode_frame(), svq1_decode_frame(), svq1_encode_frame(), svq3_decode_init(), svq3_parse_packet(), swf_read_header(), swf_read_packet(), swri_get_dither(), sws_allocVec(), sws_getDefaultFilter(), sws_init_context(), sws_scale(), tak_read_header(), text2movsub(), tgv_decode_frame(), tiff_decode_tag(), tiff_unpack_fax(), tm2_build_huff_table(), tscc2_decode_init(), tta_encode_init(), unescape(), unpack_codebook(), update_thread_context(), utvideo_decode_init(), utvideo_encode_init(), var_read_string(), vble_decode_init(), vc1t_read_header(), vf_open(), vfw_read_header(), vid_read_packet(), video_audio_display(), vmd_read_header(), vmdvideo_decode_init(), vorbis_parse_id_hdr(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_residues(), vp56_size_changed(), vp8_decode_frame(), vp8_encode(), vpx_init(), vqa_decode_init(), vqf_read_header(), vs_set_mem_and_log_functions(), wavesynth_init(), wc3_read_header(), write_extradata(), write_frame(), wtvfile_open_sector(), X264_init(), xan_decode_init(), XAVS_init(), xiph_handle_packet(), xiph_parse_fmtp_pair(), xmv_process_packet_header(), xmv_read_header(), xvid_encode_init(), xvid_strip_vol_header(), and xwma_read_header().

av_alloc_size ( ,
 
)

Helper function to allocate a block of size * nmemb bytes with using av_malloc()

Helper function to allocate a block of size * nmemb bytes with using av_mallocz()

Parameters
nmembNumber of elements
sizeSize of the single element
Returns
Pointer to the allocated block, NULL if the block cannot be allocated.
See Also
av_malloc()
Parameters
nmembNumber of elements
sizeSize of the single element
Returns
Pointer to the allocated block, NULL if the block cannot be allocated.
See Also
av_mallocz()
av_malloc_array()
return av_malloc ( nmemb size)
void* av_realloc ( void ptr,
size_t  size 
)

Allocate or reallocate a block of memory.

If ptr is NULL and size > 0, allocate a new block. If size is zero, free the memory block pointed to by ptr.

Parameters
ptrPointer to a memory block already allocated with av_malloc(z)() or av_realloc() or NULL.
sizeSize in bytes for the memory block to be allocated or reallocated.
Returns
Pointer to a newly reallocated block or NULL if the block cannot be reallocated or the function is used to free the memory block.
See Also
av_fast_realloc()

Definition at line 141 of file mem.c.

Referenced by add_file(), add_fragment(), add_pat_entry(), add_serial_pair(), add_tracked_method(), alloc_and_copy(), allocate_buffers(), asfrtp_parse_packet(), ass_split_section(), av_bprint_alloc(), av_bprint_finalize(), av_buffer_realloc(), av_dict_set(), av_dynarray2_add(), av_dynarray_add(), av_fast_realloc(), av_frame_new_side_data(), av_packet_new_side_data(), av_probe_input_buffer(), av_realloc_array(), av_realloc_f(), avfilter_graph_alloc_filter(), avformat_new_stream(), bmv_read_packet(), concat_open(), concatenate_packet(), decode_frame(), draw_text(), ebml_parse_elem(), ff_alsa_extend_reorder_buf(), ff_ass_add_rect(), ff_insert_pad(), ff_program_add_stream_index(), filter_frame(), fixup_vorbis_headers(), flashsv_decode_frame(), g2m_load_cursor(), get_packet(), get_tcp_server_response(), grow_array(), h264_extradata_to_annexb(), handle_file(), handle_notify(), jpg_decode_data(), libschroedinger_encode_frame(), load_textfile(), main(), matroska_decode_buffer(), matroska_deliver_packet(), matroska_parse_wavpack(), mkv_add_cuepoint(), mkv_add_seekhead_entry(), mov_build_index(), mov_read_extradata(), mov_read_trex(), mov_read_trun(), mxf_add_metadata_set(), mxf_read_partition_pack(), mxf_write_packet(), mxf_write_partition(), new_video_stream(), nut_read_header(), nut_write_packet(), ogg_new_stream(), ogg_restore(), probe_codec(), qt_rtp_parse_packet(), rdt_parse_sdp_line(), realloc_buffer(), realloc_section_array(), reconfigure_at_keyframe(), rtmp_http_write(), rtmp_open(), sample_queue_push(), smacker_read_packet(), tgv_decode_inter(), theora_header(), tm2_read_stream(), update_context_from_user(), update_index(), vc1_decode_frame(), vp56_size_changed(), vs_set_mem_and_log_functions(), and xan_decode_frame().

void* av_realloc_f ( void ptr,
size_t  nelem,
size_t  elsize 
)

Allocate or reallocate a block of memory.

This function does the same thing as av_realloc, except:

  • It takes two arguments and checks the result of the multiplication for integer overflow.
  • It frees the input block in case of failure, thus avoiding the memory leak with the classic "buf = realloc(buf); if (!buf) return -1;".

Definition at line 168 of file mem.c.

Referenced by alloc_array_elem(), alloc_table(), av_reallocp_array(), avi_read_header(), avi_write_packet(), config_output(), copy_chapters(), decode_frame(), dyn_buf_write(), ffio_rewind_with_probe_data(), gxf_write_map_packet(), gxf_write_packet(), mov_read_uuid(), parse_commands(), parse_forced_key_frames(), parse_intervals(), queue_frames(), and read_whole_file().

av_alloc_size ( ,
 
)

Allocate or reallocate an array.

If ptr is NULL and nmemb > 0, allocate a new block. If nmemb is zero, free the memory block pointed to by ptr.

Parameters
ptrPointer to a memory block already allocated with av_malloc(z)() or av_realloc() or NULL.
nmembNumber of elements
sizeSize of the single element
Returns
Pointer to a newly reallocated block or NULL if the block cannot be reallocated or the function is used to free the memory block.

If *ptr is NULL and nmemb > 0, allocate a new block. If nmemb is zero, free the memory block pointed to by ptr.

Parameters
ptrPointer to a pointer to a memory block already allocated with av_malloc(z)() or av_realloc(), or pointer to a pointer to NULL. The pointer is updated on success, or freed on failure.
nmembNumber of elements
sizeSize of the single element
Returns
Zero on success, an AVERROR error code on failure.
void av_free ( void ptr)

Free a memory block which has been allocated with av_malloc(z)() or av_realloc().

Parameters
ptrPointer to the memory block which should be freed.
Note
ptr = NULL is explicitly allowed.
It is recommended that you use av_freep() instead.
See Also
av_freep()

Definition at line 199 of file mem.c.

Referenced by a64multi_close_encoder(), aac_decode_frame(), add_file(), add_pes_stream(), amr_free_context(), ape_tag_read_field(), append_entry(), asf_write_trailer(), asfrtp_free_context(), asfrtp_parse_packet(), atrac3_decode_close(), audio_decode_example(), audio_encode_example(), av_audio_convert_free(), av_audio_fifo_free(), av_bitstream_filter_close(), av_buffer_default_free(), av_dict_free(), av_dict_set(), av_dump_format(), av_expr_parse(), av_fft_end(), av_fifo_free(), av_fifo_realloc2(), av_file_unmap(), av_free_packet(), av_freep(), av_hash_alloc(), av_hmac_alloc(), av_hmac_free(), av_image_alloc(), av_opt_get_key_value(), av_opt_query_ranges_default(), av_opt_set_bin(), av_opt_set_from_string(), av_parser_close(), av_parser_init(), av_probe_input_buffer(), av_realloc_f(), av_samples_alloc(), av_tree_destroy(), avcodec_alloc_context3(), avcodec_thread_init(), avfilter_free(), avfilter_init_str(), avfilter_ref_buffer(), avfilter_unref_buffer(), avformat_free_context(), avformat_new_stream(), avi_read_close(), avi_write_trailer(), avio_close(), avio_close_dyn_buf(), avpicture_free(), avpriv_dv_init_demux(), bfi_decode_close(), build_filter(), caf_write_packet(), callback(), cdxl_decode_end(), celt_header(), channelmap_filter_frame(), close(), close_audio(), close_connection(), close_null_ctx(), close_video(), cmdutils_read_file(), cng_decode_close(), cng_encode_close(), concat_open(), config_input(), config_output(), convert_str(), cook_decode_close(), copy_frame(), data_open(), decode_end(), decode_frame(), decode_lowdelay(), decode_slice(), decode_text_chunk(), decode_thread(), decode_video(), delete_cluts(), delete_objects(), delete_region_display_list(), delete_regions(), dilate_init(), dirac_parse_close(), dnxhd_encode_end(), do_adobe_auth(), do_llnw_auth(), doTest(), doubles2str(), dshow_cycle_formats(), dshow_cycle_pins(), dshow_read_close(), dshow_read_packet(), dv1394_close(), dv_read_close(), dv_read_timecode(), dvbsub_close_decoder(), dvbsub_parse_page_segment(), dvbsub_parse_region_segment(), dvdsub_parse_extradata(), ebml_free(), ebml_read_ascii(), encode_close(), encode_dvd_subtitles(), encode_end(), encode_frame(), encode_picture_ls(), enu_free(), escape124_decode_close(), escape124_decode_frame(), ff_ass_split_free(), ff_audio_data_alloc(), ff_audio_data_free(), ff_audio_mix_alloc(), ff_audio_mix_free(), ff_audio_mix_set_matrix(), ff_audio_resample_free(), ff_audio_resample_init(), ff_avfilter_default_free_buffer(), ff_cavs_end(), ff_ccitt_unpack(), ff_command_queue_pop(), ff_create_schro_frame(), ff_dct_end(), ff_dct_init(), ff_dither_free(), ff_do_elbg(), ff_fast_malloc(), ff_filter_alloc(), ff_free_mp_image(), ff_free_parser_state(), ff_gen_syncpoint_search(), ff_h264_decode_picture_parameter_set(), ff_h264_decode_seq_parameter_set(), ff_http_auth_create_response(), ff_http_match_no_proxy(), ff_iir_filter_free_coeffs(), ff_iir_filter_free_state(), ff_init_elbg(), ff_init_vlc_sparse(), ff_isom_write_avcc(), ff_jpegls_decode_picture(), ff_mjpeg_decode_end(), ff_mjpeg_encode_close(), ff_mov_add_hinted_packet(), ff_mov_close_hinting(), ff_mov_write_packet(), ff_mp4_read_dec_config_descr(), ff_mpegts_parse_close(), ff_nut_add_sp(), ff_packet_free_side_data(), ff_parse_fmtp(), ff_pca_free(), ff_png_zfree(), ff_psy_preprocess_end(), ff_rdt_parse_close(), ff_read_packet(), ff_restore_parser_state(), ff_rtmp_calc_digest(), ff_rtp_chain_mux_open(), ff_rtp_check_and_send_back_rr(), ff_rtp_parse_close(), ff_rtp_reset_packet_queue(), ff_rtp_send_punch_packets(), ff_rtp_send_rtcp_feedback(), ff_rtsp_close_streams(), ff_rtsp_setup_output_streams(), ff_rtsp_undo_setup(), ff_snow_alloc_blocks(), ff_snow_release_buffer(), ff_store_parser_state(), ff_tls_deinit(), ff_vf_get_image(), ff_wma_end(), ff_wms_parse_sdp_a_line(), ff_xvid_rate_control_init(), ff_yuv2rgb_c_init_tables(), ffio_ensure_seekback(), ffio_fdopen(), ffio_rewind_with_probe_data(), ffio_set_buf_size(), ffmpeg_cleanup(), film_read_close(), film_read_header(), film_read_packet(), find_and_decode_index(), find_motion(), flac_parse(), flac_parse_close(), flac_read_header(), flashsv_decode_end(), flashsv_encode_end(), flv_get_extradata(), flv_queue_extradata(), flv_write_packet(), fourxm_read_header(), frame_list_clear(), frame_list_remove_samples(), free_context(), free_entries(), free_filter_param(), free_fragment_if_needed(), free_frame_if_needed(), free_geobtag(), free_packet_list(), free_segment_list(), free_temp(), free_tracked_methods(), free_variant_list(), frei0r_init(), ftp_current_dir(), ftp_file_size(), ftp_passive_mode(), g2m_init_buffers(), generate_codebook(), generate_new_codebooks(), get_buffer2(), get_cookies(), get_meta(), get_metadata(), get_moov_size(), get_private_data(), get_tag(), glyph_enu_free(), guess_ni_flag(), h263_free_context(), h263_handle_packet(), h264_extradata_to_annexb(), h264_free_context(), handle_file(), handle_invoke_error(), handle_invoke_result(), hls_write_header(), hls_write_trailer(), http_connect(), http_parse_request(), http_receive_data(), id3v2_parse(), iec61883_close(), iec61883_parse_queue_dv(), iec61883_parse_queue_hdv(), img_read_header(), init(), init_coef_vlc(), init_cook_mlt(), init_filters(), init_pass2(), init_pattern_from_file(), init_report(), initFilter(), interpolate(), ism_flush(), ism_free(), jacosub_decode_frame(), jpeg_free_context(), latm_decode_audio_specific_config(), latm_free_context(), latm_parse_packet(), lavfi_read_header(), libschroedinger_decode_frame(), libschroedinger_free_frame(), link_filter_inouts(), load_mask(), load_path(), m4sl_cb(), main(), make_digest_auth(), matroska_clear_queue(), matroska_decode_buffer(), matroska_deliver_packet(), matroska_parse_block(), matroska_parse_frame(), matroska_parse_rm_audio(), matroska_read_close(), matroska_read_header(), mimic_decode_end(), mjpeg_decode_com(), mkv_flush_dynbuf(), mkv_write_attachments(), mkv_write_block(), mkv_write_codecprivate(), mkv_write_seekhead(), mkv_write_trailer(), mmap_close(), mmap_init(), mmap_release_buffer(), mms_close(), mmsh_read_seek(), mov_create_chapter_track(), mov_create_timecode_track(), mov_flush_fragment(), mov_read_cmov(), mov_read_dref(), mov_read_dvc1(), mov_read_glbl(), mov_read_packet(), mov_read_strf(), mov_read_stsz(), mov_read_uuid(), mov_read_wave(), mov_write_ctts_tag(), mov_write_dvc1_structs(), mov_write_isml_manifest(), mov_write_stts_tag(), mov_write_trailer(), mov_write_udta_tag(), mpc8_parse_seektable(), mpeg_mux_init(), mpegps_read_pes_header(), mpegts_close_filter(), mpegts_free_context(), mpegts_open_section_filter(), mpegts_set_stream_info(), mpegts_write_end(), mpegts_write_header(), mpegts_write_packet_internal(), mxf_compute_index_tables(), mxf_get_sorted_table_segments(), mxf_read_generic_descriptor(), mxf_read_local_tags(), new_connection(), new_output_stream(), new_stream(), nsv_parse_NSVf_header(), nsv_read_close(), nut_read_header(), ogg_new_buf(), ogg_read_close(), ogg_read_page(), ogg_restore(), ogg_write_page(), ogm_chapter(), open_null_ctx(), open_slave(), opt_channel_layout(), opt_old2new(), opt_qscale(), opt_show_entries(), opt_show_format_entry(), opt_timecode(), opt_vstats_file(), packet_queue_get(), parse_device_name(), parse_filter(), parse_fmtp_config(), parse_frames(), parse_inputs(), parse_interval(), parse_key_value_pair(), parse_options(), parse_outputs(), parse_setup_header(), parse_times(), parse_video_var(), pcx_decode_frame(), pmt_cb(), pp_free_context(), pp_free_mode(), pp_get_mode_by_name_and_quality(), prepare_sdp_description(), print_codecs(), process_line(), process_options(), put_packet(), qcelp_free_context(), qdm2_extradata_free(), qt_rtp_free(), qt_rtp_parse_packet(), qtrle_encode_end(), queue_frames(), radix_sort(), rdt_free_context(), rdt_new_context(), read_chapter(), read_frame(), read_geobtag(), read_shape_from_file(), read_tag(), read_whole_file(), reallocAlign(), redspark_read_header(), release_buffer(), resample_init(), rl2_decode_end(), rl2_read_header(), rm_write_audio(), roq_encode_end(), roq_encode_video(), rtmp_open(), rtp_new_av_stream(), rtp_new_connection(), rtp_parse_mp4_au(), rtp_parse_queued_packet(), rtsp_cmd_describe(), sami_paragraph_to_ass(), sample_queue_free(), sample_queue_pop(), sap_write_header(), sbg_read_header(), sdp_parse_fmtp_config_h264(), sdt_cb(), seg_write_trailer(), segment_list_print_entry(), seq_read_close(), set_enable_expr(), set_expr(), set_params(), set_string_binary(), shift_data(), shorts2str(), show_codecs(), show_stream(), smacker_decode_header_tree(), smacker_read_close(), smacker_read_header(), smka_decode_frame(), sp5x_decode_frame(), Stagefright_decode_frame(), storeframe(), stream_close(), stream_open(), svq1_decode_frame(), svq3_decode_init(), svq3_extradata_free(), svq3_parse_packet(), swri_get_dither(), swri_realloc_audio(), sws_addVec(), sws_convVec(), sws_freeContext(), sws_freeFilter(), sws_freeVec(), sws_scale(), sws_shiftVec(), sws_subVec(), tcp_write_packet(), tgv_decode_end(), thread_entry(), thread_free(), tiff_unpack_fax(), tm2_build_huff_table(), tm2_free_codes(), tqi_decode_end(), truemotion1_decode_end(), tta_decode_close(), twin_decode_close(), uninit(), update_context_from_user(), url_open_dyn_buf_internal(), var_read_float(), var_read_int(), vc1_decode_frame(), vc1_decode_init(), vc1_extract_headers(), vda_h264_end_frame(), vda_h264_release_buffer(), vfw_read_close(), vfw_read_packet(), video_audio_display(), video_decode_example(), video_encode_example(), videostream_cb(), vmd_read_close(), vmd_read_header(), vmdvideo_decode_end(), vorbis_free(), vorbis_parse_setup_hdr_codebooks(), vp56_size_changed(), vp6_decode_free(), vp8_encode(), vp8_free_buffer(), vp8_free_context(), vs_set_mem_and_log_functions(), wavesynth_close(), wavesynth_init(), worker(), write_audio_frame(), write_globalinfo(), write_header_chunk(), write_headers(), write_streaminfo(), write_trailer(), wtvfile_close(), wtvfile_open_sector(), x11grab_read_header(), X264_close(), XAVS_close(), xiph_free_context(), xiph_parse_fmtp_pair(), xmv_process_packet_header(), and xwma_read_header().

void* av_mallocz ( size_t  size)

Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.

Parameters
sizeSize in bytes for the memory block to be allocated.
Returns
Pointer to the allocated block, NULL if it cannot be allocated.
See Also
av_malloc()

Definition at line 221 of file mem.c.

Referenced by a64multi_init_encoder(), aac_adtstoasc_filter(), aac_decode_frame(), aac_encode_init(), add_av_stream1(), add_codec(), add_fragment(), add_input_streams(), add_pes_stream(), add_to_pktbuf(), add_to_queue(), adx_read_header(), afc_read_header(), aiff_read_header(), aiff_write_packet(), alac_encode_init(), alloc_scratch_buffers(), alloc_sequence_buffers(), allocate_buffers(), allocate_tables(), amr_new_context(), asf_read_stream_properties(), asfrtp_new_context(), atrac3_decode_init(), audio_get_buffer(), av_abuffersink_params_alloc(), av_aes_alloc(), av_audio_fifo_alloc(), av_bitstream_filter_init(), av_buffer_create(), av_buffer_pool_init(), av_buffer_ref(), av_calloc(), av_dict_set(), av_dump_format(), av_expr_parse(), av_fifo_alloc(), av_frame_alloc(), av_frame_new_side_data(), av_frame_ref(), av_hash_alloc(), av_hmac_alloc(), av_md5_alloc(), av_murmur3_alloc(), av_new_program(), av_opencl_alloc_external_env(), av_opencl_get_device_list(), av_opt_query_ranges_default(), av_parser_init(), av_ripemd_alloc(), av_sha512_alloc(), av_sha_alloc(), av_tree_node_alloc(), avcodec_fill_audio_frame(), avcodec_get_context_defaults3(), avcodec_open2(), avcodec_thread_init(), avfilter_graph_alloc(), avfilter_graph_queue_command(), avfilter_inout_alloc(), avfilter_link(), avfilter_thread_init(), avformat_alloc_output_context2(), avformat_find_stream_info(), avformat_new_stream(), avformat_open_input(), avi_read_header(), avi_write_header(), avio_alloc_context(), avisynth_load_library(), avpriv_dv_init_demux(), avpriv_new_chapter(), avresample_alloc_context(), avui_encode_init(), bfi_decode_init(), callback(), channelmap_filter_frame(), che_configure(), cng_decode_init(), compute_mask(), compute_mask_matrix(), config(), config_input(), config_output(), configure_filtergraph(), cook_decode_init(), copy_chapters(), decode_dvd_subtitles(), decode_frame(), decode_init(), decode_lowdelay(), decode_main_header(), decode_pic(), decode_picture_header(), decode_stream_header(), decode_thread(), DEF_CHOOSE_FORMAT(), dfa_decode_init(), display_end_segment(), doTest(), dv_read_timecode(), dvbsub_display_end_segment(), dvbsub_parse_display_definition_segment(), dvbsub_parse_page_segment(), dvbsub_parse_region_segment(), encode_init(), encode_picture_ls(), enqueue_packet(), extract_mpeg4_header(), ff_all_channel_counts(), ff_all_channel_layouts(), ff_all_samplerates(), ff_ass_add_rect(), ff_ass_split(), ff_audio_data_alloc(), ff_audio_mix_alloc(), ff_audio_resample_init(), ff_avc_write_annexb_extradata(), ff_cavs_init_top_lines(), ff_create_schro_frame(), ff_default_get_video_buffer(), ff_dither_alloc(), ff_fast_malloc(), ff_filter_alloc(), ff_frame_thread_encoder_init(), ff_generate_avci_extradata(), ff_graph_thread_init(), ff_h264_decode_picture_parameter_set(), ff_h264_decode_seq_parameter_set(), ff_huffyuv_alloc_temp(), ff_iir_filter_init_state(), ff_interleave_add_packet(), ff_intrax8_common_init(), ff_ivi_init_planes(), ff_ivi_init_tiles(), ff_jpegls_decode_picture(), ff_lpc_init(), ff_lzw_decode_open(), ff_merge_channel_layouts(), ff_mjpeg_decode_sof(), ff_mp4_read_dec_config_descr(), ff_mpegts_parse_open(), ff_nut_add_sp(), ff_pca_init(), ff_psy_init(), ff_psy_preprocess_init(), ff_rate_control_init(), ff_rdt_parse_open(), ff_rm_alloc_rmstream(), ff_rtp_parse_open(), ff_rtsp_setup_output_streams(), ff_schro_queue_push_back(), ff_slice_buffer_init(), ff_snow_alloc_blocks(), ff_snow_common_init_after_header(), ff_timefilter_new(), ff_vc1_decode_init_alloc_tables(), ff_wms_parse_sdp_a_line(), ffurl_register_protocol(), ffv1_init_slice_contexts(), find_headers_search_validate(), flac_read_header(), flashsv2_encode_init(), flashsv_decode_frame(), flashsv_encode_frame(), flashsv_encode_init(), flv_get_extradata(), flv_queue_extradata(), flv_write_header(), frame_thread_init(), g2m_init_buffers(), g722_encode_init(), get_audio_buffer(), get_buffer(), get_buffer2(), get_buffer_internal(), get_device_list(), get_http_header_data(), get_private_data(), get_siz(), gif_encode_init(), guess_ni_flag(), gxf_write_header(), h263_new_context(), h264_new_context(), h264_slice_header_init(), handle_file(), http_prepare_data(), http_server(), ico_write_header(), iec61883_callback(), init(), init_er(), init_input_filter(), init_muxer(), init_parse_context(), init_pattern_from_file(), init_pattern_from_string(), init_tiles(), ism_write_header(), join_config_output(), join_init(), join_request_frame(), jpeg_new_context(), latm_new_context(), lavfi_read_header(), libopus_encode_init(), libschroedinger_encode_frame(), link_filter_inouts(), load_glyph(), main(), make_eval_expr(), make_point(), matroska_parse_frame(), matroska_parse_laces(), matroska_parse_rm_audio(), matroska_read_header(), mj2_create_image(), mkv_start_cues(), mkv_start_seekhead(), mkv_write_header(), mmsh_open_internal(), mmsh_read_seek(), mov_read_chapters(), mov_read_covr(), mov_read_dref(), mov_read_dvc1(), mov_read_glbl(), mov_read_strf(), mov_read_trak(), mov_read_uuid(), mov_read_wave(), mov_text_encode_init(), mov_write_dvc1_structs(), mov_write_header(), mp_decode_init(), mpc8_read_header(), mpc_read_header(), mpeg_mux_init(), mpeg_mux_write_packet(), mpegts_add_service(), mpegts_new_context(), mpegts_open_pes_filter(), mpegts_open_section_filter(), mpegts_write_header(), mss2_decode_init(), mxf_parse_structural_metadata(), mxf_read_local_tags(), mxf_timestamp_to_str(), mxf_uid_to_str(), mxf_write_header(), mxpeg_decode_mxm(), new_connection(), new_context(), new_output_stream(), new_stream(), new_variant(), new_video_stream(), nsv_parse_NSVf_header(), nsv_parse_NSVs_header(), nut_read_header(), nut_write_header(), ogg_buffer_page(), ogg_build_flac_headers(), ogg_build_opus_headers(), ogg_build_speex_headers(), ogg_save(), ogg_write_header(), ogg_write_vorbiscomment(), oma_read_header(), opaque_list_push(), open_input_file(), open_output_file(), opt_channel_layout(), opt_filter_complex(), opt_filter_complex_script(), opus_header(), paf_vid_init(), parse_acl_row(), parse_dynamic_acl(), parse_ffconfig(), parse_fmtp_config(), parse_inputs(), parse_keyframes_index(), parse_primary(), parse_sws_flags(), pool_alloc_buffer(), prepare_sdp_description(), psy_3gpp_init(), pthread_cond_init(), pthread_create(), put_main_header(), qcelp_new_context(), qdm2_extradata_new(), qdm2_parse_config(), qt_rtp_new(), qt_rtp_parse_packet(), qtrle_encode_init(), rdt_new_context(), rdt_parse_b64buf(), read_apic(), read_geobtag(), read_header(), read_kuki_chunk(), read_shape_from_file(), read_tfra(), ready_codebook(), ready_residue(), reallocAlign(), resample_init(), rl2_decode_init(), rl2_read_header(), roq_encode_init(), rtp_new_av_stream(), rtp_new_connection(), rtsp_read_header(), rv34_decoder_alloc(), sap_write_header(), segment_end(), setup_find_stream_info_opts(), smacker_decode_header_tree(), smacker_read_header(), smka_decode_frame(), sp5x_decode_frame(), speex_header(), Stagefright_close(), Stagefright_decode_frame(), Stagefright_init(), stream_open(), svq1_encode_init(), svq1_encode_plane(), svq3_decode_init(), svq3_extradata_new(), swr_alloc(), swri_realloc_audio(), swri_rematrix_init(), swri_rematrix_init_x86(), sws_alloc_context(), theora_header(), tiff_decode_tag(), tm2_build_huff_table(), transcode_init(), tta_read_header(), update_dimensions(), url_alloc_for_protocol(), url_open_dyn_buf_internal(), utvideo_encode_init(), vc1_decode_frame(), vc1_decode_init(), vc1_extract_headers(), vda_h264_end_frame(), vf_open(), videostream_cb(), vmd_read_header(), vorbis_header(), vorbis_parse_id_hdr(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_mappings(), vorbis_parse_setup_hdr_modes(), vorbis_parse_setup_hdr_residues(), vp6_decode_init(), vp8_new_context(), vs_set_mem_and_log_functions(), wmv2_encode_init(), worker(), writer_open(), wsvqa_read_header(), wsvqa_read_packet(), wtvfile_open_sector(), wv_alloc_frame_context(), XAVS_init(), xiph_new_context(), xwma_read_header(), and yop_read_header().

void* av_calloc ( size_t  nmemb,
size_t  size 
)

Allocate a block of nmemb * size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.

The allocation will fail if nmemb * size is greater than or equal to INT_MAX.

Parameters
nmemb
size
Returns
Pointer to the allocated block, NULL if it cannot be allocated.

Definition at line 229 of file mem.c.

Referenced by av_samples_alloc_array_and_samples(), config_audio_output(), config_input(), config_output(), config_props(), config_video_output(), encode_dvd_subtitles(), ff_avfilter_graph_config_pointers(), ff_pca_init(), get_codecs_sorted(), get_histogram(), init(), interpolate(), movie_common_init(), mxf_compute_index_tables(), mxf_compute_ptses_fake_index(), mxf_get_sorted_table_segments(), mxf_read_content_storage(), mxf_read_generic_descriptor(), mxf_read_index_entry_array(), mxf_read_material_package(), mxf_read_primer_pack(), mxf_read_sequence(), mxf_read_source_package(), probe_file(), resample_init(), set_enable_expr(), swri_rematrix_init(), and wavesynth_parse_extradata().

return av_mallocz ( nmemb size)
char* av_strdup ( const char *  s)
void* av_memdup ( const void p,
size_t  size 
)

Duplicate the buffer p.

Parameters
pbuffer to be duplicated
Returns
Pointer to a newly allocated buffer containing a copy of p or NULL if the buffer cannot be allocated.

Definition at line 248 of file mem.c.

void av_freep ( void ptr)

Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer pointing to it to NULL.

Parameters
ptrPointer to the pointer to the memory block which should be freed.
See Also
av_free()

Definition at line 214 of file mem.c.

Referenced by aac_decode_close(), aac_encode_close(), aac_encode_end(), aacPlus_encode_close(), add_doubles_metadata(), add_file(), add_shorts_metadata(), adpcm_encode_close(), adx_read_header(), aic_decode_close(), aiff_write_packet(), aiff_write_trailer(), alac_decode_close(), alac_encode_close(), alloc_scratch_buffers(), allocate_buffers(), ape_decode_close(), ape_read_close(), ape_tag_read_field(), asf_read_picture(), asf_read_stream_properties(), asf_write_header1(), asfrtp_free_context(), asfrtp_parse_packet(), atrac3_decode_init(), audio_encode_example(), audio_get_buffer(), av_asprintf(), av_bitstream_filter_close(), av_bprint_finalize(), av_buffer_alloc(), av_buffer_create(), av_buffer_realloc(), av_buffer_unref(), av_dict_free(), av_dict_set(), av_dynarray2_add(), av_dynarray_add(), av_expr_free(), av_fast_padded_malloc(), av_fast_padded_mallocz(), av_fft_init(), av_fifo_alloc(), av_fifo_free(), av_frame_copy_props(), av_frame_free(), av_frame_new_side_data(), av_frame_unref(), av_free_packet(), av_hash_freep(), av_opencl_free_device_list(), av_opencl_free_external_env(), av_opencl_get_device_list(), av_opt_free(), av_opt_freep_ranges(), av_parser_init(), av_probe_input_buffer(), av_samples_alloc_array_and_samples(), av_tempfile(), av_write_trailer(), avcodec_close(), avcodec_copy_context(), avcodec_fill_audio_frame(), avcodec_free_frame(), avcodec_get_frame_defaults(), avcodec_open2(), avfilter_copy_buffer_ref_props(), avfilter_free(), avfilter_graph_alloc(), avfilter_graph_free(), avfilter_graph_parse(), avfilter_graph_parse2(), avfilter_graph_parse_ptr(), avfilter_init_str(), avfilter_inout_free(), avfilter_link_free(), avfilter_ref_buffer(), avfilter_unref_buffer(), avformat_find_stream_info(), avformat_free_context(), avi_read_close(), avi_read_header(), avi_write_trailer(), avio_close(), avisynth_atexit_handler(), avisynth_load_library(), avisynth_read_packet_audio(), avisynth_read_packet_video(), avresample_close(), avresample_free(), avresample_set_matrix(), avsubtitle_free(), avui_encode_close(), bmv_read_close(), buffer_pool_free(), build_feed_streams(), caca_write_trailer(), cache_open(), caf_write_trailer(), calc_rice_params(), che_configure(), clean_tracks(), cleanup(), clear_programs(), cllc_decode_close(), close_connection(), close_decoder(), close_filter_param(), compute_mask(), compute_mask_matrix(), concat_close(), concat_open(), concat_read_close(), config_input(), config_output(), config_props(), configure_input_filter(), configure_output_audio_filter(), configure_output_filter(), configure_output_video_filter(), copy_parameter_set(), crypto_close(), data_close(), dca_decode_end(), decimate_uninit(), decode(), decode_close(), decode_dvd_subtitles(), decode_end(), decode_frame(), decode_init(), decode_packet(), decode_picture_header(), decode_slice_header(), decode_str(), decode_update_thread_context(), destroy_buffers(), dfa_decode_end(), dnxhd_encode_end(), do_exit(), doTest(), dvbsub_close_decoder(), dvbsub_parse_close(), dvdsub_parse(), dvdsub_parse_close(), ebml_free(), ebml_read_binary(), eightsvx_decode_close(), eightsvx_decode_frame(), encode_close(), encode_end(), encode_init(), encode_nals(), encode_picture(), encode_picture_ls(), escape130_decode_close(), escape130_decode_init(), estimate_best_b_count(), expand_function(), extract_header(), extract_mpeg4_header(), Faac_encode_close(), ff_ac3_encode_close(), ff_ac3_float_mdct_end(), ff_af_queue_close(), ff_alsa_close(), ff_ape_write_tag(), ff_ass_split_free(), ff_audio_data_free(), ff_audio_data_realloc(), ff_audio_mix_alloc(), ff_audio_mix_free(), ff_audio_resample_free(), ff_avc_parse_nal_units_buf(), ff_avfilter_default_free_buffer(), ff_bgmc_end(), ff_cavs_end(), ff_command_queue_pop(), ff_dither_free(), ff_dwt_destroy(), ff_fft_end(), ff_fft_init(), ff_filter_alloc(), ff_flac_parse_picture(), ff_frame_thread_encoder_free(), ff_free_stream(), ff_free_vlc(), ff_generate_avci_extradata(), ff_graph_thread_free(), ff_graph_thread_init(), ff_h264_free_context(), ff_huffyuv_common_end(), ff_id3v2_free_extra_meta(), ff_id3v2_write_apic(), ff_init_vlc_sparse(), ff_interleave_packet_per_dts(), ff_intrax8_common_end(), ff_ivi_init_tiles(), ff_jpeg2000_cleanup(), ff_load_image(), ff_lpc_end(), ff_lzw_decode_close(), ff_mdct_end(), ff_merge_channel_layouts(), ff_merge_formats(), ff_merge_samplerates(), ff_mjpeg_decode_end(), ff_mjpeg_decode_sof(), ff_mms_read_header(), ff_mov_add_hinted_packet(), ff_mov_close_hinting(), ff_mov_init_hinting(), ff_MPV_common_end(), ff_MPV_common_frame_size_change(), ff_MPV_encode_end(), ff_mpv_frame_size_alloc(), ff_mss12_decode_end(), ff_packet_free_side_data(), ff_parse_close(), ff_pca_free(), ff_psy_end(), ff_psy_preprocess_end(), ff_rate_control_uninit(), ff_rtmp_packet_destroy(), ff_rtp_finalize_packet(), ff_rtsp_setup_input_streams(), ff_schro_queue_pop(), ff_slice_buffer_destroy(), ff_slice_buffer_init(), ff_sndio_close(), ff_sndio_open(), ff_snow_common_end(), ff_snow_common_init_after_header(), ff_srtp_free(), ff_subtitles_queue_clean(), ff_thread_video_encode_frame(), ff_timefilter_destroy(), ff_vaapi_common_end_frame(), ff_vc1_decode_end(), ff_vda_create_decoder(), ff_vda_destroy_decoder(), ff_vorbis_comment(), ff_vp56_free_context(), ffio_rewind_with_probe_data(), ffm_close(), ffmpeg_cleanup(), ffurl_closep(), ffv1_close(), fieldmatch_uninit(), filter_frame(), find_smallest_bounding_rectangle(), fixup_vorbis_headers(), flac_decode_close(), flac_encode_close(), flac_parse(), flac_parse_close(), flac_read_header(), flac_write_block_comment(), flashsv_decode_frame(), flv_read_close(), flv_read_packet(), fourxm_read_close(), fourxm_read_header(), frame_thread_free(), free_acl_list(), free_apic(), free_buffers(), free_bundles(), free_coded_frame(), free_context_frame(), free_device_list(), free_duplicate_context(), free_frame_buffers(), free_geotags(), free_packet_buffer(), free_schro_frame(), free_script(), free_section(), free_segment_list(), free_sequence_buffers(), free_tables(), free_variant_list(), g2m_decode_end(), g722_encode_close(), generate_dither_noise(), get_audio_buffer(), get_buffer_internal(), get_codec_data(), get_cookies(), get_device_list(), get_frame_defaults(), get_http_header_data(), get_tag(), get_tcp_server_response(), gif_decode_close(), gif_encode_close(), gif_write_trailer(), glyph_enu_free(), guess_dc(), gxf_write_trailer(), h264_mp4toannexb_filter(), handle_connection(), handle_file(), hls_read_header(), http_connect(), http_prepare_data(), http_send_data(), ico_write_trailer(), id3v2_put_ttag(), init(), init_er(), init_pattern_from_file(), initFilter(), ism_free(), ivi_free_buffers(), ivi_init_tiles(), join_config_output(), join_uninit(), jpeg2000_dec_cleanup(), jpg_free_context(), lag_decode_end(), latm_parse_packet(), lavfi_read_close(), libopenjpeg_encode_close(), libopenjpeg_encode_init(), libopus_encode_close(), libopus_encode_init(), libschroedinger_decode_buffer_free(), libschroedinger_decode_close(), libschroedinger_encode_close(), libschroedinger_encode_frame(), libschroedinger_free_frame(), load_glyph(), main(), matroska_clear_queue(), matroska_deliver_packet(), matroska_parse_frame(), matroska_parse_wavpack(), matroska_read_header(), md5_close(), mj2_create_image(), mjpega_dump_header(), mkv_strip_wavpack(), mkv_write_simpletag(), mkv_write_trailer(), mmap_read_frame(), mmsh_close(), mmsh_open_internal(), modplug_read_close(), mov_read_chapters(), mov_read_close(), mov_read_ctts(), mov_read_ftyp(), mov_read_hdlr(), mov_read_stsz(), mov_read_trak(), mov_write_header(), mov_write_trailer(), movie_uninit(), mp3_queue_flush(), mp3lame_encode_close(), mp_decode_end(), mpc7_decode_close(), mpc_read_close(), mpegts_close_filter(), mpegts_write_end(), mpegts_write_header(), mss2_decode_end(), mss3_decode_end(), mss3_decode_init(), mss4_decode_end(), mxf_compute_ptses_fake_index(), mxf_free(), mxf_get_sorted_table_segments(), mxf_interleave_get_packet(), mxf_read_close(), mxf_read_utf16_string(), mxf_write_footer(), mxg_close(), mxpeg_decode_end(), mxpeg_decode_mxm(), new_stream(), nsv_read_close(), nut_read_close(), nut_write_header(), nut_write_trailer(), ogg_new_stream(), ogg_replace_stream(), ogg_write_header(), ogg_write_pages(), ogg_write_trailer(), oggvorbis_encode_close(), open_input_file(), opt_map(), packet_queue_flush(), paf_vid_close(), parse_command(), parse_ffconfig(), parse_fmtp_config(), parse_iplconvkernel(), parse_key_value_pair(), parse_keyframes_index(), parse_link_name(), parse_presentation_segment(), parse_primary(), parse_sws_flags(), pmp_close(), print_sdp(), probe_codec(), probe_file(), process_command(), process_line(), prores_encode_close(), psy_3gpp_end(), pthread_cond_destroy(), put_str16(), qdm2_parse_config(), qt_rtp_free(), qt_rtp_parse_packet(), queue_pop(), r3d_close(), rdt_free_context(), rdt_parse_packet(), CustomSource::read(), read_apic(), read_close(), read_frame(), read_from_packet_buffer(), read_gab2_sub(), read_header(), read_header_gme(), read_kuki_chunk(), read_thread(), read_ttag(), realloc_buffer(), remove_decoded_packets(), resample_free(), roq_dpcm_encode_close(), rtmp_calc_swfhash(), rtmp_close(), rtmp_http_close(), rtmp_open(), rtp_write_trailer(), rtsp_read_close(), rv34_decoder_free(), sample_queue_free(), sap_read_close(), sap_write_close(), sap_write_header(), sbg_read_header(), sdl_write_trailer(), sdp_parse_fmtp_config_h264(), seg_write_trailer(), segment_end(), set_expr(), set_string(), set_string_binary(), shorten_decode_close(), show_help(), slice_thread_uninit(), smjpeg_read_header(), smvjpeg_decode_end(), sox_read_header(), spdif_write_trailer(), split_uninit(), Stagefright_close(), Stagefright_decode_frame(), Stagefright_init(), stop_jack(), stream_component_close(), sunrast_decode_frame(), svq1_encode_end(), svq3_decode_end(), svq3_decode_init(), svq3_parse_packet(), swf_read_packet(), swr_free(), swri_rematrix_free(), sws_allocVec(), sws_freeContext(), sws_freeVec(), tak_decode_close(), tak_read_header(), tee_write_header(), tgv_decode_end(), tgv_decode_frame(), thread_free(), tiff_decode_tag(), tiff_end(), transcode(), tscc2_decode_end(), tta_decode_close(), tta_encode_close(), udp_open(), uninit(), uninit_options(), uninit_parse_context(), url_alloc_for_protocol(), utvideo_decode_close(), utvideo_encode_close(), v308_encode_close(), v408_encode_close(), v410_encode_close(), vble_decode_close(), vfw_read_header(), vid_read_close(), vid_read_packet(), video_encode_example(), vorbis_cleanup(), vorbis_encode_close(), vorbis_free(), vorbis_header(), vp3_decode_end(), vp8_free(), vqa_decode_end(), vqa_decode_init(), wavpack_decode_end(), worker(), write_chapter(), write_headers(), write_option(), writer_close(), wtvfile_close(), x11grab_read_header(), X264_close(), xan_decode_end(), xan_decode_init(), XAVS_close(), xface_encode_close(), xiph_handle_packet(), xmv_read_close(), xvid_encode_close(), y41p_encode_close(), yae_release_buffers(), and yuv4_encode_close().

void av_dynarray_add ( void tab_ptr,
int *  nb_ptr,
void elem 
)

Add an element to a dynamic array.

The array to grow is supposed to be an array of pointers to structures, and the element to add must be a pointer to an already allocated structure.

The array is reallocated when its size reaches powers of 2. Therefore, the amortized cost of adding an element is constant.

In case of success, the pointer to the array is updated in order to point to the new grown array, and the number pointed to by nb_ptr is incremented. In case of failure, the array is freed, *tab_ptr is set to NULL and *nb_ptr is set to 0.

Parameters
tab_ptrpointer to the array to grow
nb_ptrpointer to the number of elements in the array
elemelement to add
See Also
av_dynarray2_add()

Definition at line 259 of file mem.c.

void* av_dynarray2_add ( void **  tab_ptr,
int *  nb_ptr,
size_t  elem_size,
const uint8_t elem_data 
)

Add an element of size elem_size to a dynamic array.

The array is reallocated when its number of elements reaches powers of 2. Therefore, the amortized cost of adding an element is constant.

In case of success, the pointer to the array is updated in order to point to the new grown array, and the number pointed to by nb_ptr is incremented. In case of failure, the array is freed, *tab_ptr is set to NULL and *nb_ptr is set to 0.

Parameters
tab_ptrpointer to the array to grow
nb_ptrpointer to the number of elements in the array
elem_sizesize in bytes of the elements in the array
elem_datapointer to the data of the element to add. If NULL, the space of the new added element is not filled.
Returns
pointer to the data of the element to copy in the new allocated space. If NULL, the new allocated space is left uninitialized."
See Also
av_dynarray_add()

Definition at line 289 of file mem.c.

static int av_size_mult ( size_t  a,
size_t  b,
size_t *  r 
)
inlinestatic

Multiply two size_t values checking for overflow.

Returns
0 if success, AVERROR(EINVAL) if overflow.

Definition at line 276 of file mem.h.

Referenced by av_realloc_f(), config_output(), decode_frame(), and ogg_new_stream().

void av_max_alloc ( size_t  max)

Set the maximum size that may me allocated in one block.

Definition at line 69 of file mem.c.

Referenced by opt_max_alloc().

void av_memcpy_backptr ( uint8_t dst,
int  back,
int  cnt 
)

deliberately overlapping memcpy implementation

Parameters
dstdestination buffer
backhow many bytes back we start (the initial size of the overlapping window), must be > 0
cntnumber of bytes to copy, must be >= 0

cnt > back is valid, this will copy the bytes we just copied, thus creating a repeating pattern with a period length of back.

Definition at line 396 of file mem.c.

Referenced by copy_backptr(), decode_dsw1(), decode_frame(), decode_tsw1(), mszh_decomp(), residual_interp(), synth_block_fcb_acb(), unpack(), and xan_unpack().

Variable Documentation

size_t size
Initial value:
{
if (size <= 0 || nmemb >= INT_MAX / size)
return NULL

Definition at line 95 of file mem.h.

size_t nmemb

Definition at line 136 of file mem.h.

size_t size
Initial value:
{
if (size <= 0 || nmemb >= INT_MAX / size)
return NULL

Definition at line 11127 of file twinvq_data.h.

Referenced by aac_parse_packet(), aac_sync(), abs_pow34_v(), adaptive_gain_control(), add_fragment(), add_metadata_from_side_data(), adp_read_packet(), adpcm_swf_decode(), adx_read_packet(), afc_read_packet(), aiff_read_header(), aiff_read_packet(), alloc_table(), amf_tag_contents(), amr_read_packet(), amr_wb_encode_frame(), ape_tag_read_field(), append(), append_packet_chunked(), apply_param_change(), apply_tns(), asf_read_ext_stream_properties(), asf_read_frame_header(), ast_read_packet(), ast_write_packet(), audio_write_packet(), av_audio_fifo_drain(), av_audio_fifo_read(), av_audio_fifo_write(), av_bprint_init_for_buffer(), av_buffer_create(), av_buffer_pool_init(), av_buffer_realloc(), av_fifo_alloc(), av_fifo_drain(), av_fifo_generic_write(), av_frame_new_side_data(), av_image_copy_to_buffer(), av_image_fill_pointers(), av_new_packet(), av_packet_from_data(), av_packet_merge_side_data(), av_packet_new_side_data(), av_packet_shrink_side_data(), av_packet_split_side_data(), av_parser_change(), av_realloc_f(), av_samples_alloc(), av_shrink_packet(), avi_load_index(), avi_read_header(), avi_read_nikon(), avi_read_packet(), avi_read_tag(), avi_sync(), avi_write_packet(), avio_close_dyn_buf(), avio_read(), avio_size(), avpriv_aac_parse_header(), avpriv_dv_get_packet(), avpriv_dv_produce_packet(), avs_new_value_array(), avs_read_audio_packet(), avs_read_packet(), avui_encode_frame(), block_sse(), bytestream2_get_bufferu(), bytestream2_put_bufferu(), bytestream2_set_bufferu(), bytestream2_skipu(), bytestream_get_buffer(), bytestream_put_buffer(), calc_deflate_block_size(), check(), check_bidir_mv(), check_checksum(), cinepak_decode_codebook(), cinepak_decode_strip(), cinepak_decode_vectors(), clean_index(), cmp_inline(), cmv_decode_frame(), codebook_trellis_rate(), commit_bitstream_and_slice_buffer(), compute_avg_bitrate(), concat_open(), concat_seek(), config_output(), construct_perm_table(), copy_tag(), crypto_read(), data_read(), daud_packet(), dca_subsubframe(), dca_xbr_parse_frame(), dec_lpc_spectrum_inv(), decode_audio(), decode_copy(), decode_deep_rle32(), decode_frame(), decode_frame_header(), decode_scaling_list(), decode_subframe(), decode_unregistered_user_data(), decode_video(), deinvert_buffer(), dshow_cycle_formats(), dump_extradata(), dv1394_read_packet(), dv_encode_ac(), dv_extract_audio(), dv_extract_video_info(), dv_frame_offset(), dv_inject_audio(), dv_read_packet(), dv_vlc_map_tableinit(), dv_work_pool_size(), dxa_read_header(), dxa_read_packet(), dxva2_h264_decode_slice(), dxva2_mpeg2_decode_slice(), dxva2_vc1_decode_slice(), encode_block(), encode_frame(), encode_init(), encode_nals(), encode_picture_ls(), encode_window_bands_info(), epzs_motion_search2(), epzs_motion_search4(), epzs_motion_search_internal(), escape_FF(), eval_lpcenv_or_interp(), event_loop(), extend_af(), extract_mpeg4_header(), ff_adaptive_gain_control(), ff_add_index_entry(), ff_add_param_change(), ff_alloc_packet2(), ff_alsa_extend_reorder_buf(), ff_amf_get_field_value(), ff_amf_tag_size(), ff_ape_write_tag(), ff_ass_split_override_codes(), ff_avc_parse_nal_units(), ff_dxva2_commit_buffer(), ff_er_frame_end(), ff_generate_avci_extradata(), ff_h264_decode_extradata(), ff_h264_decode_sei(), ff_huff_gen_len_table(), ff_isom_write_avcc(), ff_mjpeg_decode_sof(), ff_mov_add_hinted_packet(), ff_mov_read_stsd_entries(), ff_mov_write_packet(), ff_mpeg4_init_partitions(), ff_pcm_read_packet(), ff_raw_read_partial_packet(), ff_rm_read_mdpr_codecdata(), ff_rtmp_packet_create(), ff_rtmp_packet_read_internal(), ff_rtmp_packet_write(), ff_rtp_send_aac(), ff_rtp_send_amr(), ff_rtp_send_h264(), ff_rtp_send_jpeg(), ff_rtp_send_mpegvideo(), ff_rtp_send_xiph(), ff_rv34_decode_frame(), ff_set_min_dist_lsf(), ff_vaapi_alloc_slice(), ff_vdpau_add_buffer(), ff_vf_mpi_clear(), ff_voc_get_packet(), ff_vorbis_comment(), ffio_limit(), ffio_read_partial(), ffm2_read_header(), ffm_read_data(), ffm_read_packet(), ffm_write_data(), ffurl_size(), fill_random(), fill_rectangle(), fill_slice(), fill_slice_long(), fill_slice_short(), find_best_tables(), find_frame_end(), find_headers_search(), find_headers_search_validate(), find_new_headers(), flashsv2_prime(), flashsv_decode_frame(), flush_encoders(), flush_packet(), flv_get_extradata(), flv_queue_extradata(), flv_read_packet(), flv_write_packet(), fourxm_read_header(), fourxm_read_packet(), full_search(), funny_diamond_search(), g723_1_read_packet(), get_codec_data(), get_mb_score(), get_packetheader(), get_private_data(), get_size_of_code(), get_tag(), gif_image_write_image(), gsm_read_packet(), guess_ni_flag(), gxf_write_mpeg_auxiliary(), h263_mv4_search(), hex_dump_internal(), hex_search(), hpel_motion_search(), http_buf_read(), http_send_data(), http_write(), iec61883_parse_queue_dv(), iec61883_parse_queue_hdv(), iec61883_read_packet(), imdct_and_window(), img_read_packet(), infer_size(), ingenient_read_packet(), init_h263_dc_for_msmpeg4(), init_uni_dc_tab(), interlaced_search(), interleave_new_audio_packet(), interpolate(), ism_flush(), jpeg_put_comments(), jpeg_table_header(), kalman_smoothen(), klv_decode_ber_length(), klv_encode_ber_length(), l2s_dia_search(), lavfi_read_packet(), linear_perm(), lpc_weighting(), lvf_read_header(), lvf_read_packet(), main(), matroska_parse_laces(), matroska_parse_wavpack(), matroska_probe(), md5_write(), memcpy_rgb332_to_bgr8(), merge(), mkv_blockgroup_size(), mkv_strip_wavpack(), mkv_write_block(), mkv_write_vtt_blocks(), mmf_read_header(), mmf_read_packet(), mms_put_utf16(), mov_build_index(), mov_create_chapter_track(), mov_read_dref(), mov_read_extradata(), mov_read_glbl(), mov_write_dvc1_structs(), mov_write_edts_tag(), mov_write_int8_metadata(), mov_write_isml_manifest(), mov_write_meta_tag(), mov_write_single_packet(), mov_write_string_data_tag(), mov_write_string_tag(), mov_write_tfrf_tag(), mov_write_tmpo_tag(), mov_write_traf_tag(), mov_write_trailer(), mov_write_trkn_tag(), mov_write_udta_tag(), mp3_parse_vbr_tags(), mp3_read_packet(), mp_get_code(), mpc8_handle_chunk(), mpc8_parse_seektable(), mpc8_probe(), mpc8_read_header(), mpc8_read_packet(), mpc_read_packet(), mpeg4_encode_dc(), mpeg_mux_write_packet(), mpegps_read_pes_header(), mpegts_probe(), mpegts_write_packet_internal(), msnwc_tcp_read_packet(), mxf_compute_sample_count(), mxf_decrypt_triplet(), mxf_read_generic_descriptor(), mxf_read_local_tags(), mxf_read_packet(), mxf_read_partition_pack(), mxf_read_sync(), mxf_write_local_tag_utf16(), mxg_read_packet(), nc_probe(), nc_read_packet(), nsv_parse_NSVf_header(), nuv_packet(), nuv_read_dts(), ogg_get_length(), ogg_new_buf(), ogg_new_stream(), ogg_read_page(), ogg_write_page(), ogg_write_vorbiscomment(), ogm_header(), output_immediate(), parse_3dl(), parse_adts_frame_header(), parse_chunks(), parse_cube(), parse_dat(), parse_forced_key_frames(), parse_m3d(), parse_packet(), parse_psfile(), pmp_header(), png_choose_filter(), png_filter_row(), png_write_row(), poll_frame(), postfilter(), predictor(), process_block(), process_ea_header(), propagate_block_data(), put_id3v2_tags(), put_meta(), put_qcd(), put_system_header(), qcp_read_header(), qdm2_decode_init(), qpel_motion_search(), quantize_and_encode_band_cost_template(), quantize_bands(), queue_frames(), r3d_read_reda(), rac_init(), radix_count(), radix_sort_pass(), raw_read_packet(), rdt_load_mdpr(), read_arbitary(), read_header(), read_index(), read_kuki_chunk(), read_packet(), read_shape_from_file(), read_table(), read_tfra(), read_tree(), read_whole_file(), redspark_read_packet(), reorder_pixels(), resample(), rl2_rle_decode(), rm_read_index(), rm_write_audio(), roq_encode_frame(), rsd_read_packet(), rso_read_header(), rtmp_http_write(), rtmp_read(), rtmp_write(), rtmpe_write(), rtp_send_mpegaudio(), rtp_send_mpegts_raw(), rtp_send_raw(), rtp_send_samples(), rtp_write_packet(), rv10_decode_frame(), rv10_write_header(), rv34_gen_vlc(), sab_diamond_search(), sample_queue_push(), search_for_quantizers_faac(), set_identity_matrix(), set_put_bits_buffer_size(), setup_partitions(), show_format(), siff_read_packet(), smacker_read_packet(), small_diamond_search(), smjpeg_read_packet(), smush_read_header(), smush_read_packet(), spdif_header_dts(), squared_diff_macroblock(), srt_decode_frame(), srt_write_packet(), srtp_write(), ssd_int8_vs_int16_altivec(), ssd_int8_vs_int16_c(), ssd_plane(), svq3_decode_init(), swr_convert(), synth_block_fcb_acb(), synth_block_hardcoded(), tak_read_header(), tcp_write_packet(), thp_read_packet(), tiff_unpack_fax(), transcode_subtitles(), tscc2_decode_frame(), tta_read_header(), tta_read_packet(), udp_read(), umh_search(), unpack(), unpack_codebook(), update_frame_pool(), update_sample_display(), updatePacketSize(), var_diamond_search(), vb_decode_palette(), vc1_decode_frame(), vc1_decode_init(), vc1_extract_headers(), vc1_unescape_buffer(), very_broken_op(), vmd_read_header(), vp6_build_huff_tree(), vqf_read_header(), vqf_read_packet(), w_c(), wavpack_decode_block(), wc3_read_header(), wc3_read_packet(), webp_decode_frame(), wmavoice_decode_packet(), write_root_table(), ws_snd_decode_frame(), wv_read_block_header(), xan_decode_frame(), xan_unpack(), xan_wc3_decode_frame(), XAVS_init(), xbm_encode_frame(), xwma_read_header(), and xwma_read_packet().