[FFmpeg-devel] [PATCH 2/6] srtdec: always return INVALIDDATA for <= 0 sized packets

Clément Bœsch u at pkh.me
Tue Oct 15 07:33:28 CEST 2013


On Sat, Oct 05, 2013 at 07:34:54PM +0200, Marton Balint wrote:
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  libavcodec/srtdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
> index b16645a..59de977 100644
> --- a/libavcodec/srtdec.c
> +++ b/libavcodec/srtdec.c
> @@ -234,7 +234,7 @@ static int srt_decode_frame(AVCodecContext *avctx,
>      }
>  
>      if (avpkt->size <= 0)
> -        return avpkt->size;
> +        return AVERROR_INVALIDDATA;
>  
>      while (ptr < end && *ptr) {
>          if (avctx->codec->id == AV_CODEC_ID_SRT) {

Why?

Are you sure you can't have a valid empty subrip packet?

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131015/3cc0e13c/attachment.asc>


More information about the ffmpeg-devel mailing list