X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fbsf.c;h=c984526e140d6df5cd307d46784242691367459b;hb=78d16eb45217f7ce811d1b05afe56427dd40021b;hp=dfb127e7eb3d8fe68700c5b83bfe8133c5490673;hpb=06136275e59c38806b04a1fc9cc92beb82db79b6;p=ffmpeg diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c index dfb127e7eb3..c984526e140 100644 --- a/libavcodec/bsf.c +++ b/libavcodec/bsf.c @@ -403,7 +403,7 @@ void av_bsf_list_free(AVBSFList **lst) { int i; - if (*lst) + if (!*lst) return; for (i = 0; i < (*lst)->nb_bsfs; ++i) @@ -514,8 +514,10 @@ int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf_lst) if (!lst) return AVERROR(ENOMEM); - if (!(dup = buf = av_strdup(str))) - return AVERROR(ENOMEM); + if (!(dup = buf = av_strdup(str))) { + ret = AVERROR(ENOMEM); + goto end; + } while (1) { bsf_str = av_strtok(buf, ",", &saveptr);