av_image_fill_plane_sizes() already sets sizes[1] to AVPALETTE_SIZE. Should fix memory leaks.
Unified · Split
| @@ -56,13 +56,9 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size), · 55 unmodified lines | ||
| 56 | 56 | { |
| 57 | 57 | int i, ret; |
| 58 | 58 | FFFramePool *pool; |
| 59 | − const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format); | |
| 60 | 59 | ptrdiff_t linesizes[4]; |
| 61 | 60 | size_t sizes[4]; |
| 62 | 61 | |
| 63 | − if (!desc) | |
| 64 | − return NULL; | |
| 65 | − | |
| 66 | 62 | pool = av_mallocz(sizeof(FFFramePool)); |
| 67 | 63 | if (!pool) |
| 68 | 64 | return NULL; |
| @@ -108,12 +104,6 @@ FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size), · 39 unmodified lines | ||
| 108 | 104 | goto fail; |
| 109 | 105 | } |
| 110 | 106 | |
| 111 | − if (desc->flags & AV_PIX_FMT_FLAG_PAL) { | |
| 112 | − pool->pools[1] = av_buffer_pool_init(AVPALETTE_SIZE, alloc); | |
| 113 | − if (!pool->pools[1]) | |
| 114 | − goto fail; | |
| 115 | − } | |
| 116 | − | |
| 117 | 107 | return pool; |
| 118 | 108 | |
| 119 | 109 | fail: |