summaryrefslogtreecommitdiff
path: root/libavformat/ffmdec.c
Commit message (Collapse)AuthorAge
* Merge commit '83548fe894cdb455cc127f754d09905b6d23c173'James Almer2017-03-21
|\ | | | | | | | | | | | | * commit '83548fe894cdb455cc127f754d09905b6d23c173': lavf: fix usage of AVIOContext.seekable Merged-by: James Almer <jamrial@gmail.com>
* | avformat/ffmdec: Silence "may be used uninitialized in this function" warningsMichael Niedermayer2016-12-03
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/ffmdec: cleanup on extradata memory allocation failureMichael Niedermayer2016-12-03
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/ffmdec: Forward error code from ffm_read_header()Michael Niedermayer2016-12-03
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/ffmdec: remove last use of st->codecMichael Niedermayer2016-12-03
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/ffmdec: Drop flags2, debug and codec->time_base settingMichael Niedermayer2016-12-03
| | | | | | | | | | | | It should still be possible to set these through recommended_encoder_configuration Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/ffmdec: Check media type for chunksMichael Niedermayer2016-12-03
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/ffmdec: replace most codec uses by codecparMichael Niedermayer2016-12-03
| | | | | | | | | | | | | | This is a bit messy as codecar does not support AVOptions so we need to use AVCodecContext where AVOptions are required and copy back and forth. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/ffmdec: Remove some st->codec uses which set encoder parametersMichael Niedermayer2016-12-03
| | | | | | | | | | | | Modern ffserver should not need these Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmdec: validate codec parametersAndreas Cadhalpun2016-11-20
| | | | | | | | | | | | | | | | A negative extradata size for example gets passed to memcpy in avcodec_parameters_from_context causing a segmentation fault. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | ffmdec: validate sample_rateAndreas Cadhalpun2016-11-07
| | | | | | | | | | | | | | A negative sample rate doesn't make sense and triggers assertions in av_rescale_rnd. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat/ffmdec: Check pix_fmtMichael Niedermayer2016-04-28
| | | | | | | | | | | | | | Fixes crash Fixes Ticket5412 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | ffserver&ffm: Fixed issues preventing ffserver write_index and files_size ↵Oliver Collyer2016-02-21
| | | | | | | | | | | | | | | | | | | | | | | | from being set correctly which was breaking ffserver streaming. I discovered that ffserver streaming was broken (it seems like it has been since 20th November) and I opened a ticket for this (https://trac.ffmpeg.org/ticket/5250 <https://trac.ffmpeg.org/ticket/5250>). I spent yesterday learning git bisect (with the kind help of cehoyos) to painstakingly track down the cause. This was made more difficult due to the presence of a segfault in ffserver during the period where the bug was introduced so I first had to identify when and how that was fixed and then retrospectively apply that fix again for each step of the second git bisect to find the actual bug. Anyway, the fruits of my labour are the innocent looking patch below to correct a couple of typos and define a valid range for two variables. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmdec: change type of len to ptrdiff_tAndreas Cadhalpun2016-01-11
| | | | | | | | | | | | | | | | | | | | It is used to store the difference between pointers, so ptrdiff_t is the correct type. This prevents potential overflows. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | ffmdec: reset packet_end in case of failureAndreas Cadhalpun2016-01-03
| | | | | | | | | | | | | | | | This fixes segmentation faults caused by passing a packet_ptr of NULL to memcpy. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat/ffmdec: Add {} to nested if/elseMichael Niedermayer2016-01-03
| | | | | | | | | | | | | | This preempts potential bugs if this is changed and the indention ends up different from C interpretation Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmdec: change type of state and id to unsignedAndreas Cadhalpun2016-01-02
| | | | | | | | | | | | | | | | This fixes ubsan runtime error: left shift by 8 places cannot be represented in type 'int' Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | ffm: reject invalid codec_id and codec_typeAndreas Cadhalpun2015-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | A negative codec_id cannot be handled by the found_decoder API of AVStream->info: if the codec_id is not recognized, found_decoder is set to -codec_id, which has to be '<0' according to the API documentation. This can cause NULL pointer dereferencing in try_decode_frame. Also make sure the codec_type matches the expected one for codec_id. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | ffmdec: reject zero-sized chunksAndreas Cadhalpun2015-12-04
| | | | | | | | | | | | | | | | If size is zero, avio_get_str fails, leaving the buffer uninitialized. This causes invalid reads in av_set_options_string. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | ffmdec: only seek back at EOF if a server is attachedAndreas Cadhalpun2015-12-04
| | | | | | | | | | | | | | | | Otherwise the ffm demuxer can return the same packets endlessly, if there is no server attached. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat/ffmdec: Only return EAGAIN if a server is attachedMichael Niedermayer2015-11-20
| | | | | | | | | | | | | | This should fix a infinite loop Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/ffmdec: Add cleaner API for ffserver to interface without depending ↵Michael Niedermayer2015-11-20
| | | | | | | | | | | | | | on internal ABI Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
| |
* | doc: fix spelling errorsAndreas Cadhalpun2015-10-09
| | | | | | | | | | Reviewed-by: Lou Logan <lou@lrcd.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Replace av_dlog with ff_dlog.Ronald S. Bultje2015-08-18
| | | | | | | | | | ff_dlog checks compilability, and is non-public. av_dlog is deprecated and no longer exists if FF_API_DLOG=0.
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * Remove avserver.Anton Khirnov2014-06-18
| | | | | | | | | | | | | | It has not been properly maintained for years and there is little hope of that changing in the future. It appears simpler to write a new replacement from scratch than unbreaking it.
* | avformat/ffmdec: Check ffio_set_buf_size() return valueMichael Niedermayer2015-06-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffmdec: Check return value of ffm_append_recommended_configurationHimangi Saraogi2015-04-10
| | | | | | | | | | Reviewed-by: Lukasz Marek <lukasz.m.luki2@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffmdec: limit the backward seek to the last resync positionAndreas Cadhalpun2015-03-09
| | | | | | | | | | | | | | | | | | | | If resyncing leads to the same position as previously, it will again lead to a resync attempt, resulting in an infinite loop. Thus don't seek back beyond the last syncpoint. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffmdec: make sure the time base is validAndreas Cadhalpun2015-03-09
| | | | | | | | | | | | | | A negative time base can trigger assertions. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffmdec: fix infinite loop at EOFAndreas Cadhalpun2015-03-09
| | | | | | | | | | | | | | | | If EOF is reached, while skipping bytes, avio_tell(pb) won't change anymore, resulting in an infinite loop. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffmdec: initialize f_cprv, f_stvi and f_stauAndreas Cadhalpun2015-03-09
| | | | | | | | | | | | | | | | They are used in a switch statement, but it is not guaranteed that the COMM case (where they are set to 0) is reached before the other cases. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/ffmdec: add common options to recommended encoder configurationLukasz Marek2014-11-27
| | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* | lavf/ffmdec: reident after last commitLukasz Marek2014-11-16
| | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* | lavf/ffm: use AVOption API to store/restore stream propertiesLukasz Marek2014-11-16
| | | | | | | | | | | | | | | | | | | | | | This is a generic solution that will not reqiore modifications when new options are added. This also fixes problem with current implementation when qmin or qmax=-1. Only 8 bits was sent and read back as 255. Fixes #1275 Fixes #1461 Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* | lavf/ffm: store/restore private codec contextLukasz Marek2014-11-16
| | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* | lavf/ffmdec: return proper error code in ffm2_read_header()Stefano Sabatini2014-09-05
| | | | | | | | Also log an error message in case of invalid packet size.
* | replace calls to url_feof() with avio_feof()James Almer2014-08-08
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | fix various typosLou Logan2014-06-03
| | | | | | | | | | Signed-off-by: Lou Logan <lou@lrcd.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/ffmdec: use ff_get_extradata()Michael Niedermayer2013-12-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-11-24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Add missing #includes for *INT64_MAX and *INT64_C Conflicts: ffmpeg.c ffmpeg_filter.c ffplay.c libavformat/assdec.c libavformat/avidec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Add missing #includes for *INT64_MAX and *INT64_CDiego Biurrun2013-11-23
| |
* | avformat: use ff_alloc_extradata()Paul B Mahol2013-10-13
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | ffmdec: remove unused variableMichael Niedermayer2012-11-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffm: redesign header format to make it extensibleMichael Niedermayer2012-11-05
| | | | | | | | | | | | | | | | | | Currently FFM files generated with one versions of ffmpeg generally cannot be read by another. By spliting data into chunks, more fields can saftely be appended to chunks as well as new chunks added. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffmdec: check av_new_packet() return valueMichael Niedermayer2012-10-17
| | | | | | | | | | Fixes CID733711 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffmdec: fix hypothetical overflowsMichael Niedermayer2012-10-17
| | | | | | | | | | Fixes CID703739 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffm_seek: fix division by zeroMichael Niedermayer2012-10-17
| | | | | | | | | | Fixes CID732202 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>