History

apv_decode: Fix memory leak on decode error

Mark Thompson committed 1 year ago

Commit 5acd2141 parent 135acc81 file · +4 −3Browse files

Unified · Split

libavcodec/apv_decode.c+4−3
@@ -385,7 +385,7 @@ static int apv_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 384 unmodified lines
385385 case APV_PBU_PRIMARY_FRAME:
386386 err = apv_decode(avctx, frame, pbu->content);
387387 if (err < 0)
388− return err;
388+ goto fail;
389389 *got_frame = 1;
390390 break;
391391 case APV_PBU_METADATA:
@@ -419,9 +419,10 @@ static int apv_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 27 unmodified lines
419419 }
420420 }
421421
422+ err = packet->size;
423+fail:
422424 ff_cbs_fragment_reset(au);
423−
424− return packet->size;
425+ return err;
425426 }
426427
427428 const FFCodec ff_apv_decoder = {

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